无法加载andenginephysicsbox2dextensi

无法加载andenginephysicsbox2dextensi

本文介绍了java.lang.UnsatisfiedLinkError:无法加载andenginephysicsbox2dextension-Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在尝试在Android Studio,而不是 eclipse"中使用 andengine 并且在运行项目时遇到此错误.

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)

在某些答案中,有人说验证您的构建路径设置,但我没有明白他的确切意思.我将库文件夹(其中包含libandenginephysicsbox2dextension.so")复制并粘贴到我的主项目 lib 文件夹中.我该怎么做才能解决这个问题.任何帮助或建议将不胜感激!

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:

已解决:http://geq-i.blogspot.com/2014/02/how-to-setup-andengine-in-android-studio.html

指的是 andengine指的是andenginebox2dextension

is referring to andengine is referring to andenginebox2dextension

推荐答案

很简单.按照这个简单的步骤

Its very simple. Follow this simple steps

1)主应用的 libs 文件夹内创建一个名为 "lib" 的新文件夹.

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

2)andEnginePhysicsBox2DExtension/libs 文件夹中复制所有文件夹 ie.armabi 、 armabi-v7a 等,然后粘贴到之前创建的 "lib"主应用程序中的文件夹.

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) 现在将 "lib" 文件夹压缩为 "lib.zip" 并将其重命名为 "lib.jar.这会将 zip 扩展名更改为 jar.

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

4) 最后在 Build.gradle 文件中的依赖项{}下添加一行 - compile files('lib.jar')主应用.

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

5) 清理并构建项目.

这篇关于java.lang.UnsatisfiedLinkError:无法加载andenginephysicsbox2dextension-Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 22:45