How to add the libandenginephysicsbox2dextension.so file in Android Studio | Andengine

ぃ、小莉子 提交于 2019-12-11 02:28:53

问题


I wanted to develop an app with Android Studio using the Andengine. After I have imported the andengine.jar and the libandenginephysicsbox2dextension.jar everything seemed to work correctly. At the point where the PhysicsWorld is created:

private void createPhysics() {
        physicsWorld = new FixedStepPhysicsWorld(60, new Vector2(0, -17), false);
        registerUpdateHandler(physicsWorld);
    }

this exception appears: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.sample.packet.sample-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libandenginephysicsbox2dextension.so"

I think I must download the *.so file but I don't know where to place it in my project. Could anyone help?


回答1:


you can follow my answer here https://stackoverflow.com/a/34068202/2026280

or

Its very simple. Follow this simple steps

1) Create a new folder called "lib" inside the libs folder of the main app.

2) Copy all the folders ie.armabi , armabi-v7a etc from andEnginePhysicsBox2DExtension/libs folder, and paste in in the previously created "lib" folder in main app.

3) Now compress the "lib" folder as "lib.zip" and rename it to "lib.jar". this changes the zip extension to jar.

4) Finally add a line -- compile files('lib.jar') under dependencies{} in Build.gradle file of your main app.

5) Clean and build the project.




回答2:


Mine is located in a directory under you application.

file : https://www.dropbox.com/s/71lxz2ec9qrn236/libandenginephysicsbox2dextension.so?dl=0



来源:https://stackoverflow.com/questions/30238885/how-to-add-the-libandenginephysicsbox2dextension-so-file-in-android-studio-and

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!