I'm trying to work with andengine in "Android studio, not eclipse" and im getting this error when i run the project.
9442-29483/com.makeinfo.andenginetemplate E/AndEngine﹕ MainActivity.onCreateScene failed. @(Thread: 'GLThread 2726')
java.lang.UnsatisfiedLinkError: Couldn't load andenginephysicsbox2dextension from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.makeinfo.andenginetemplate-1.apk,libraryPath=/data/app-lib/com.makeinfo.andenginetemplate-1]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:355)
at java.lang.System.loadLibrary(System.java:525)
at org.andengine.extension.physics.box2d.PhysicsWorld.<clinit>(PhysicsWorld.java:35)
at com.makeinfo.andenginetemplate.MainActivity.onCreateScene(MainActivity.java:71)
at org.andengine.ui.activity.BaseGameActivity$3.onCreateResourcesFinished(BaseGameActivity.java:169)
at com.makeinfo.andenginetemplate.MainActivity.onCreateResources(MainActivity.java:55)
at org.andengine.ui.activity.BaseGameActivity.onCreateGame(BaseGameActivity.java:181)
at org.andengine.ui.activity.BaseGameActivity.onSurfaceCreated(BaseGameActivity.java:110)
at org.andengine.opengl.view.EngineRenderer.onSurfaceCreated(EngineRenderer.java:80)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1509)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248)
In some answers, someone said verify your build path settings but i didn't get what he exactly meant. I copied and pasted the library folders (which got "libandenginephysicsbox2dextension.so" inside of them) into my main projects lib folder. What should i do to fix this problem. Any help or suggestions will be appreciated!
Here is the project folder setup:
SOLVED: http://geq-i.blogspot.com/2014/02/how-to-setup-andengine-in-android-studio.html
is referring to andengine is referring to andenginebox2dextension
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.
Place your jni precompiled libraries (.so files) as per the following structure