我已将 jnix.jar 文件放在 libs 文件夹中并添加到构建路径中。但是当我尝试使用 System.loadLibrary("jnix") 加载库时,我收到以下崩溃。它虽然列在引用的库中。
03-07 22:04:24.822: E/streamer(8746): Couldn't load jnix: findLibrary returned null
03-07 22:04:24.822: E/streamer(8746): java.lang.UnsatisfiedLinkError: Couldn't load jnix: findLibrary returned null
03-07 22:04:24.822: E/streamer(8746): at java.lang.Runtime.loadLibrary(Runtime.java:365)
03-07 22:04:24.822: E/streamer(8746): at java.lang.System.loadLibrary(System.java:535)
03-07 22:04:24.822: E/streamer(8746): at ob.android.MainActivity.<clinit>(MainActivity.java:38)
03-07 22:04:24.822: E/streamer(8746): at java.lang.Class.newInstanceImpl(Native Method)
03-07 22:04:24.822: E/streamer(8746): at java.lang.Class.newInstance(Class.java:1319)
03-07 22:04:24.822: E/streamer(8746): at android.app.Instrumentation.newActivity(Instrumentation.java:1039)
03-07 22:04:24.822: E/streamer(8746): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2101)
03-07 22:04:24.822: E/streamer(8746): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2229)
03-07 22:04:24.822: E/streamer(8746): at android.app.ActivityThread.access$600(ActivityThread.java:139)
03-07 22:04:24.822: E/streamer(8746): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
03-07 22:04:24.822: E/streamer(8746): at android.os.Handler.dispatchMessage(Handler.java:99)
03-07 22:04:24.822: E/streamer(8746): at android.os.Looper.loop(Looper.java:154)
03-07 22:04:24.822: E/streamer(8746): at android.app.ActivityThread.main(ActivityThread.java:4945)
03-07 22:04:24.822: E/streamer(8746): at java.lang.reflect.Method.invokeNative(Native Method)
03-07 22:04:24.822: E/streamer(8746): at java.lang.reflect.Method.invoke(Method.java:511)
03-07 22:04:24.822: E/streamer(8746): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-07 22:04:24.822: E/streamer(8746): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-07 22:04:24.822: E/streamer(8746): at dalvik.system.NativeStart.main(Native Method)
03-07 22:04:24.822: W/dalvikvm(8746): Exception Ljava/lang/RuntimeException; thrown while initializing Lob/android/MainActivity;
03-07 22:04:24.822: W/dalvikvm(8746): Class init failed in newInstance call (Lob/android/MainActivity;)
03-07 22:04:24.822: D/AndroidRuntime(8746): Shutting down VM
03-07 22:04:24.822: W/dalvikvm(8746): threadid=1: thread exiting with uncaught exception (group=0x40abe228)
03-07 22:04:24.862: E/AndroidRuntime(8746): FATAL EXCEPTION: main
03-07 22:04:24.862: E/AndroidRuntime(8746): java.lang.ExceptionInInitializerError
03-07 22:04:24.862: E/AndroidRuntime(8746): at java.lang.Class.newInstanceImpl(Native Method)
03-07 22:04:24.862: E/AndroidRuntime(8746): at java.lang.Class.newInstance(Class.java:1319)
03-07 22:04:24.862: E/AndroidRuntime(8746): at android.app.Instrumentation.newActivity(Instrumentation.java:1039)
03-07 22:04:24.862: E/AndroidRuntime(8746): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2101)
03-07 22:04:24.862: E/AndroidRuntime(8746): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2229)
03-07 22:04:24.862: E/AndroidRuntime(8746): at android.app.ActivityThread.access$600(ActivityThread.java:139)
03-07 22:04:24.862: E/AndroidRuntime(8746): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
03-07 22:04:24.862: E/AndroidRuntime(8746): at android.os.Handler.dispatchMessage(Handler.java:99)
03-07 22:04:24.862: E/AndroidRuntime(8746): at android.os.Looper.loop(Looper.java:154)
03-07 22:04:24.862: E/AndroidRuntime(8746): at android.app.ActivityThread.main(ActivityThread.java:4945)
03-07 22:04:24.862: E/AndroidRuntime(8746): at java.lang.reflect.Method.invokeNative(Native Method)
03-07 22:04:24.862: E/AndroidRuntime(8746): at java.lang.reflect.Method.invoke(Method.java:511)
03-07 22:04:24.862: E/AndroidRuntime(8746): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-07 22:04:24.862: E/AndroidRuntime(8746): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-07 22:04:24.862: E/AndroidRuntime(8746): at dalvik.system.NativeStart.main(Native Method)
03-07 22:04:24.862: E/AndroidRuntime(8746): Caused by: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Couldn't load jnix: findLibrary returned null
03-07 22:04:24.862: E/AndroidRuntime(8746): at ob.android.MainActivity.<clinit>(MainActivity.java:47)
03-07 22:04:24.862: E/AndroidRuntime(8746): ... 15 more
03-07 22:04:24.862: E/AndroidRuntime(8746): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load jnix: findLibrary returned null
03-07 22:04:24.862: E/AndroidRuntime(8746): at java.lang.Runtime.loadLibrary(Runtime.java:365)
03-07 22:04:24.862: E/AndroidRuntime(8746): at java.lang.System.loadLibrary(System.java:535)
03-07 22:04:24.862: E/AndroidRuntime(8746): at ob.android.MainActivity.<clinit>(MainActivity.java:38)
03-07 22:04:24.862: E/AndroidRuntime(8746): ... 15 more