Я использую Ubuntu 10.10
Я НЕ использую NDK
Я скомпилировал свою общую библиотеку ARM в DS-5 (набор инструментов разработки ARM, http://www.keil.com/arm/ds5/),Когда я поместил их в libs / armeabi и вызвал System.loadLibrary (), он не может их найти.
Вот класс:
package org.me.testds5;
//a JNI wrapper class
public class WrapMyNative
{
static
{
//ERROR HERE
//note that calling
//System.loadLibrary("libAddSub"); generates the same error
System.loadLibrary("AddSub");
}
//some native functions
public native int add(int a, int b);
public native int sub(int n, int m);
}
Точное имя библиотеки - libAddSub.so
LogCat:
11-30 04:54:11.273: ERROR/AndroidRuntime(372): FATAL EXCEPTION: main
11-30 04:54:11.273: ERROR/AndroidRuntime(372): java.lang.ExceptionInInitializerError
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at org.me.testds5.TestDS5.onCreate(TestDS5.java:13)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at android.os.Handler.dispatchMessage(Handler.java:99)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at android.os.Looper.loop(Looper.java:123)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at android.app.ActivityThread.main(ActivityThread.java:4627)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at java.lang.reflect.Method.invokeNative(Native Method)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at java.lang.reflect.Method.invoke(Method.java:521)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at dalvik.system.NativeStart.main(Native Method)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): Caused by: java.lang.UnsatisfiedLinkError: Library AddSub not found
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at java.lang.Runtime.loadLibrary(Runtime.java:461)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at java.lang.System.loadLibrary(System.java:557)
11-30 04:54:11.273: ERROR/AndroidRuntime(372): at org.me.testds5.WrapMyNative.<clinit>(WrapMyNative.java:7)