Failed to load box2d library for libgdx

I have a libGDX project that is built using maven. In the past, it worked fine, but recently it stops working due to the fact that libGDX moves box2d to the extension. I added the extension as a dependency on the core of my project, like any other dependency:

<dependency>
    <groupId>com.badlogicgames.gdx</groupId>
    <artifactId>gdx-box2d</artifactId>
    <version>${gdx.version}</version>
    <scope>compile</scope>
</dependency>

however, when I try to start a project for the desktop (or something else, really), I get the following error:

[java] Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'gdx-box2d64.dll' for target: Windows 7, 64-bit
[java]  at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:115)
[java]  at com.badlogic.gdx.physics.box2d.World.<clinit>(World.java:185)
[java]  ... 11 more
[java] Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Unable to read file for extraction: gdx-box2d64.dll
[java]  at com.badlogic.gdx.utils.SharedLibraryLoader.readFile(SharedLibraryLoader.java:124)
[java]  at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:245)
[java]  at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:113)
[java]  ... 12 more

Does anyone know what this error means, and how can I fix it? I'm not sure what other information I should provide, although I will add any code or information if you are asked.

+4
source share
1

, ,

<dependency>
    <groupId>com.badlogicgames.gdx</groupId>
    <artifactId>gdx-box2d-platform</artifactId>
    <classifier>natives-desktop</classifier>
    <version>${gdx.version}</version>
    <scope>compile</scope>
</dependency>

Android iOS, (natives-x86, natives-armebi, natives-armeabiv7, natives-ios)

+3

Source: https://habr.com/ru/post/1537144/


All Articles