我的java代码中有这个:
static {
System.loadLibrary("test");
}
我在cpp目录中有test.cpp文件。
System.loadLibrary("test");
将此错误返回给logcat:
01-25 19:45:47.282 28509-28509/com.noppapadi.ndktest E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.noppapadi.ndktest, PID: 28509
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.noppapadi.ndktest-1/base.apk", zip file "/data/app/com.noppapadi.ndktest-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.noppapadi.ndktest-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.noppapadi.ndktest-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.noppapadi.ndktest-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.noppapadi.ndktest-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.noppapadi.ndktest-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.noppapadi.ndktest-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.noppapadi.ndktest-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.noppapadi.ndktest-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.noppapadi.ndktest-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.noppapadi.ndktest-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.noppapadi.ndktest-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libtest.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:988)
at com.noppapadi.ndktest.MainActivity.<clinit>(MainActivity.java:13)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1606)
at android.app.Instrumentation.newActivity(Instrumentation.java:1071)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2433)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2625)
at android.app.ActivityThread.access$700(ActivityThread.java:183)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1484)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5667)
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:962)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
我如何解决这个问题?
感谢您的回答!