无法使用此错误编译代码应用崩溃

时间:2017-02-16 13:22:59

标签: android android-studio

此错误已在我的logcat中显示:

  

java.lang.UnsatisfiedLinkError:dlopen失败:找不到符号   由“libhello-jni.so”引用的“atof”......                                                                                 在java.lang.Runtime.loadLibrary(Runtime.java:364)                                                                                 在java.lang.System.loadLibrary(System.java:526)                                                                                 在com.example.hellojni.HelloJni。(HelloJni.java:36)                                                                                 at java.lang.Class.newInstanceImpl(Native Method)                                                                                 在java.lang.Class.newInstance(Class.java:1208)                                                                                 在android.app.Instrumentation.newActivity(Instrumentation.java:1067)                                                                                 在   android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2297)                                                                                 在   android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)                                                                                 在android.app.ActivityThread.access $ 900(ActivityThread.java:175)                                                                                 在   android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1308)                                                                                 在android.os.Handler.dispatchMessage(Handler.java:102)                                                                                 在android.os.Looper.loop(Looper.java:146)                                                                                 在android.app.ActivityThread.main(ActivityThread.java:5602)                                                                                 at java.lang.reflect.Method.invokeNative(Native Method)                                                                                 在java.lang.reflect.Method.invoke(Method.java:515)                                                                                 在   com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1283)                                                                                 在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)                                                                                 在dalvik.system.NativeStart.main(本地方法)

问题是什么?

1 个答案:

答案 0 :(得分:0)

如果您使用的是某些本机库,则可以使用下面的代码使其在特定位置查看。将它放在build.gradle文件的defaultConfig中。

   ndk {
        abiFilters "armeabi-v7a", "x86", "armeabi", "mips"
    }