ExceptionInInitializerError Physics World

别说谁变了你拦得住时间么 提交于 2019-11-29 16:42:26
Szörényi Ádám

Probably native libraries (.so files from lib dir) is missing from your APK. Check your project settings / build configuration.

If you're using android studio, you have to modify the sourceSet of andEngine and andEnginePhysicsBox2DExtension in build.gradle.

You have a folder in that projects where there are so files, you need to include the native libraries from there.

Check my answer here: jniLibs are not extended in gradle

Update based on your comments:

Add this to andEngine, andEnginePhysicsBox2d and your game build.gradle:

sourceSets {
    main {
        jni.srcDirs = []
        jniLibs.srcDir 'libs'
    }
}

Also add this to the defaultConfig section, for andEngine:

ndk {
   moduleName "andEngine"
}

and for andEnginePhysicsBox2d:

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