2016-10-18 16 views
1

我使用的是Windows 10和Cocos2dx-13.1。我是能够建立使用运行时Cocos2d-x项目崩溃:ClassLoader引用未知路径:Android Studio Studio中的/data/app/org.cocos2dx.MyFirstGame-1/lib/x86

cocos compile -p android 13 -m debug 

我的项目文件,但是当我在Android Studio的模拟器中运行它,模拟器崩溃,我得到这个错误日志:

ClassLoader referenced unknown path: /data/app/org.cocos2dx.MyFirstGame-1/lib/x86 
    10-18 13:37:07.875 10364-10364/org.cocos2dx.MyFirstGameD/AndroidRuntime: Shutting down VM 
    10-18 13:37:07.875 10364-10364/org.cocos2dx.MyFirstGameE/AndroidRuntime: FATAL EXCEPTION: main 
                      Process: org.cocos2dx.MyFirstGame, PID: 10364 
                      java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.cocos2dx.MyFirstGame-1/base.apk"],nativeLibraryDirectories=[/data/app/org.cocos2dx.MyFirstGame-1/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libMyGame.so" 
                       at java.lang.Runtime.loadLibrary0(Runtime.java:972) 
                       at java.lang.System.loadLibrary(System.java:1530) 
                       at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:248) 
                       at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:264) 
                       at android.app.Activity.performCreate(Activity.java:6664) 
                       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) 
                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599) 
                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) 
                       at android.app.ActivityThread.-wrap12(ActivityThread.java) 
                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) 
                       at android.os.Handler.dispatchMessage(Handler.java:102) 
                       at android.os.Looper.loop(Looper.java:154) 
                       at android.app.ActivityThread.main(ActivityThread.java:6077) 
                       at java.lang.reflect.Method.invoke(Native Method) 
                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) 
                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 

我认为这个错误是根的问题,但我不知道如何解决它:

ClassLoader referenced unknown path: /data/app/org.cocos2dx.MyFirstGame-1/lib/x86 

回答

0

我读过你使用的是Android Studio。截至目前,Android Studio不支持Cocos2d-x。你不能简单地依靠他们的模拟器来运行你的APK。我建议在真实设备上测试或使用Bluestacks Emulator。

我认为这在this question中突出显示。

0

发生此错误是因为您没有编译x86架构的cocos2d-x。

更改为这Application.mk文件:

APP_ABI := armeabi armeabi-v7a x86 

然后重新编译和测试。