简体   繁体   English

运行 cocoa2dx 项目时出错

[英]Error while running cocoa2dx project

Manifest显现

<application android:label="@string/app_name" 
android:allowBackup="true" android:icon="@mipmap/ic_launcher"> 
<!-- Tell Cocos2dxActivity the name of our .so --> 
<meta-data android:name="android.app.lib_name" android:value="MyGame" />
<activity ............../> </intent-filter> </activity> 
</application>

Error:错误:

com.xxx.xxxxxx E/AndroidRuntime: FATAL EXCEPTION: main Process: com.xxx.xxxxxxx, PID: 15913 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xxx.xxxxx-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] 
>couldn't find "libMyGame.so"                                      at java.lang.Runtime.loadLibrary(Runtime.java:366)
                                                                   at java.lang.System.loadLibrary(System.java:989)
                                                                   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:5966)
                                                                   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
                                                                   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2408)
                                                                   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2519)
                                                                   at android.app.ActivityThread.access$800(ActivityThread.java:162)
                                                                   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
                                                                   at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                   at android.os.Looper.loop(Looper.java:189)
                                                                   at android.app.ActivityThread.main(ActivityThread.java:5532)
                                                                   at java.lang.reflect.Method.invoke(Native Method)
                                                                   at java.lang.reflect.Method.invoke(Method.java:372)
                                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
                                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)

it redirect me in file它在文件中重定向我

Cocos2dxActivity.java:248 in code line System.loadLibrary(libName); Cocos2dxActivity.java:248 在代码行System.loadLibrary(libName);

I am stuck with this error.我被这个错误困住了。 Help me.帮我。

I am using cocos2d-x-3.13我正在使用 cocos2d-x-3.13

Android NDK, Revision 12 
Latest SDK
Android-studio 2.1.3
python 2.7.12
apache-ant 1.9.7
JDK 1.8

Thanks in advance.提前致谢。

couldn't find "libMyGame.so"

This error happens because you didn't compiled for the architecture you are trying to test on.发生此错误是因为您没有针对您尝试测试的架构进行编译。

Change to this in Application.mk file:在 Application.mk 文件中更改为:

APP_ABI := armeabi armeabi-v7a x86

Then recompile and test.然后重新编译并测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM