2016-10-18 13 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 

然後重新編譯和測試。