2018-01-04 Android 加载动态库的策略

BOOOM

E  FATAL EXCEPTION: main
                         E  Process: org.cocos2dx.tapcore, PID: 27377
                         E  java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.cocos2dx.tapcore-1/base.apk"],nativeLibra
                            ryDirectories=[/data/app/org.cocos2dx.tapcore-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libcocos2dcpp.so"
                         E      at java.lang.Runtime.loadLibrary(Runtime.java:366)
                         E      at java.lang.System.loadLibrary(System.java:989)
                         E      at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:288)
                         E      at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:303)
                         E      at org.cocos2dx.cpp.AppActivity.onCreate(AppActivity.java:40)
                         E      at android.app.Activity.performCreate(Activity.java:5975)
                         E      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111)
                         E      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2423)
                         E      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2532)
                         E      at android.app.ActivityThread.access$800(ActivityThread.java:169)
                         E      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
                         E      at android.os.Handler.dispatchMessage(Handler.java:111)
                         E      at android.os.Looper.loop(Looper.java:194)
                         E      at android.app.ActivityThread.main(ActivityThread.java:5556)
                         E      at java.lang.reflect.Method.invoke(Native Method)
                         E      at java.lang.reflect.Method.invoke(Method.java:372)
                         E      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:967)
                         E      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
                Process  I  Sending signal. PID: 27377 SIG: 9

表明 arm64 位下没有找到 libcocos2dcpp.so 库:

把 apk 解压,可以看到除了 armeabi,其他架构下还有动态库,但是其他架构下却没有 libcocos2dcpp.so 。

解决办法:
把其他架构删掉,只保留 armeabi 就好了。

你可能感兴趣的:(2018-01-04 Android 加载动态库的策略)