On Aug 27, 4:27 pm, fadden <
fad...@android.com> wrote:
>
> What does the logcat output show?
Here is what the logcat says:
08-28 09:02:20.371: INFO/ActivityManager(570): Start proc
com.example.hellojni for activity com.example.hellojni/.HelloJni:
pid=746 uid=10020 gids={}
08-28 09:02:21.212: DEBUG/dalvikvm(746): Trying to load lib /data/data/
com.example.hellojni/lib/libtestelib.so 0x43597cc0
08-28 09:02:21.221: DEBUG/dalvikvm(746): Added shared lib /data/data/
com.example.hellojni/lib/libtestelib.so 0x43597cc0
08-28 09:02:21.221: DEBUG/dalvikvm(746): No JNI_OnLoad found in /data/
data/com.example.hellojni/lib/libtestelib.so 0x43597cc0
08-28 09:02:21.281: DEBUG/dalvikvm(746): +++ not scanning '/system/lib/
libwebcore.so' for 'stringFromJNI' (wrong CL)
08-28 09:02:21.281: DEBUG/dalvikvm(746): +++ not scanning '/system/lib/
libmedia_jni.so' for 'stringFromJNI' (wrong CL)
08-28 09:02:21.281: WARN/dalvikvm(746): No implementation found for
native Lcom/example/hellojni/HelloJni;.stringFromJNI ()V
08-28 09:02:21.281: DEBUG/AndroidRuntime(746): Shutting down VM
08-28 09:02:21.281: WARN/dalvikvm(746): threadid=3: thread exiting
with uncaught exception (group=0x4000fe70)
08-28 09:02:21.281: ERROR/AndroidRuntime(746): Uncaught handler:
thread main exiting due to uncaught exception
08-28 09:02:21.312: ERROR/AndroidRuntime(746):
java.lang.UnsatisfiedLinkError: stringFromJNI
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
com.example.hellojni.HelloJni.stringFromJNI(Native Method)
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
com.example.hellojni.HelloJni.onCreate(HelloJni.java:42)
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2231)
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2284)
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
android.os.Handler.dispatchMessage(Handler.java:99)
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
android.os.Looper.loop(Looper.java:123)
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
android.app.ActivityThread.main(ActivityThread.java:3948)
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
java.lang.reflect.Method.invokeNative(Native Method)
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
java.lang.reflect.Method.invoke(Method.java:521)
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
08-28 09:02:21.312: ERROR/AndroidRuntime(746): at
dalvik.system.NativeStart.main(Native Method)
Apparently, the VM coud not find the native function implementation.
That would be expected if i did not declare it with the extern "C"
directive, but that is not the case. Am I missing something?