Welp经过多次尝试后,我找到了一个完全说明如何为android设置cocos 2d的教程。不幸的是,有三件事情我无法解释。
问题1
Apon打开日食时,它会通过以下警告向我致意:
05-20 22:27:54.940: D/ResourcesManager(27703): creating new AssetManager and set to /data/app/com.broccoli.mygame-1/base.apk
05-20 22:27:54.990: D/AndroidRuntime(27703): Shutting down VM
05-20 22:27:54.990: E/AndroidRuntime(27703): FATAL EXCEPTION: main
05-20 22:27:54.990: E/AndroidRuntime(27703): Process: com.broccoli.mygame, PID: 27703
05-20 22:27:54.990: E/AndroidRuntime(27703): java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.broccoli.mygame-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libMyGame.so"
05-20 22:27:54.990: E/AndroidRuntime(27703): at java.lang.Runtime.loadLibrary(Runtime.java:366)
05-20 22:27:54.990: E/AndroidRuntime(27703): at java.lang.System.loadLibrary(System.java:989)
05-20 22:27:54.990: E/AndroidRuntime(27703): at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:246)
05-20 22:27:54.990: E/AndroidRuntime(27703): at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:260)
05-20 22:27:54.990: E/AndroidRuntime(27703): at android.app.Activity.performCreate(Activity.java:6289)
05-20 22:27:54.990: E/AndroidRuntime(27703): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
05-20 22:27:54.990: E/AndroidRuntime(27703): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
05-20 22:27:54.990: E/AndroidRuntime(27703): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758)
05-20 22:27:54.990: E/AndroidRuntime(27703): at android.app.ActivityThread.access$900(ActivityThread.java:177)
05-20 22:27:54.990: E/AndroidRuntime(27703): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448)
05-20 22:27:54.990: E/AndroidRuntime(27703): at android.os.Handler.dispatchMessage(Handler.java:102)
05-20 22:27:54.990: E/AndroidRuntime(27703): at android.os.Looper.loop(Looper.java:145)
05-20 22:27:54.990: E/AndroidRuntime(27703): at android.app.ActivityThread.main(ActivityThread.java:5942)
05-20 22:27:54.990: E/AndroidRuntime(27703): at java.lang.reflect.Method.invoke(Native Method)
05-20 22:27:54.990: E/AndroidRuntime(27703): at java.lang.reflect.Method.invoke(Method.java:372)
05-20 22:27:54.990: E/AndroidRuntime(27703): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
05-20 22:27:54.990: E/AndroidRuntime(27703): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
第2期
当查看设备导航器时,即使它与sdk版本相同,我的手机也会获得一个黄色三角形。然而eclipse仍然接受它,所以我不知道这是否真的是一个问题。
第3期
在我的设备上启动时,控制台会显示此消息并且应用程序崩溃。
-Cocos2d-x-3.11
- Apache ant 1.9.7
- Python 27
- Android ndk r11c
- Android sdk with a ton of add the extra sdk's.
- Targeting android 5.0.1
- Java
- Eclipse
我正在使用:
throttle max: 100, per: 1.day
答案 0 :(得分:0)
要解决问题3"无法找到" libMyGame.so",您需要检查应用程序清单xml文件中的值以及libMyGame.so的位置。
1。 请参阅应用程序标记,以加载" libMygame.so"把android:value =" MyGame" (没有lib前缀)在元数据标记内。
<!-- your Application tag -->
<!-- Tell Cocos2dxActivity the name of our .so -->
<meta-data android:name="android.app.lib_name" android:value="MyGame" />