dlopen failed: cannot locate sym
2017-07-12 本文已影响0人
程序员学园
jni中使用
(*env)->GetIntArrayRegion(env, mjintArray, 0, cLen, cPArray);
时出现crash
07-12 20:52:05.931: E/AndroidRuntime(2900): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__aeabi_memclr4" referenced by "/data/app/com.example.testndkeclipse-2/lib/arm/libTestNdk.so"...
07-12 20:52:05.931: E/AndroidRuntime(2900): at java.lang.Runtime.loadLibrary(Runtime.java:372)
07-12 20:52:05.931: E/AndroidRuntime(2900): at java.lang.System.loadLibrary(System.java:1076)
07-12 20:52:05.931: E/AndroidRuntime(2900): at com.example.testndkeclipse.MainActivity.<clinit>(MainActivity.java:19)
07-12 20:52:05.931: E/AndroidRuntime(2900): at java.lang.Class.newInstance(Native Method)
07-12 20:52:05.931: E/AndroidRuntime(2900): at android.app.Instrumentation.newActivity(Instrumentation.java:1079)
07-12 20:52:05.931: E/AndroidRuntime(2900): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2597)
07-12 20:52:05.931: E/AndroidRuntime(2900): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2762)
07-12 20:52:05.931: E/AndroidRuntime(2900): at android.app.ActivityThread.-wrap11(ActivityThread.java)
07-12 20:52:05.931: E/AndroidRuntime(2900): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1584)
07-12 20:52:05.931: E/AndroidRuntime(2900): at android.os.Handler.dispatchMessage(Handler.java:111)
07-12 20:52:05.931: E/AndroidRuntime(2900): at android.os.Looper.loop(Looper.java:207)
07-12 20:52:05.931: E/AndroidRuntime(2900): at android.app.ActivityThread.main(ActivityThread.java:5915)
07-12 20:52:05.931: E/AndroidRuntime(2900): at java.lang.reflect.Method.invoke(Native Method)
07-12 20:52:05.931: E/AndroidRuntime(2900): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:955)
07-12 20:52:05.931: E/AndroidRuntime(2900): at com.android.internal
奇怪的是一个ZTE BA601 手机运行正常,一个魅蓝U20 打开就crash。
通过定位发现
如果lib下没有编译生成arm64-v8a平台的so文件就报错。
按道理来讲只需要 armeabi 平台就可以了,不知为何。
知道的朋友留言告知下!谢谢!!
微信的安装包在只编译了armeabi,没有x86,arm64-v8a是如何运行在各种处理器的手机上的
NdkDemo代码已上传至Github