Hi,
This is a very useful information. I am also debugging a similar
issue. I have a JNI call from an Activity and it works fine and I can
display the string that is returned by my JNI code to activity which
then prints on screen. This is the basic hello-jni sample app from
NDK. I have tried to move the System.loadLibrary call to a service
class in the onStart(), along with the nativa function definitions but
I get an app error and log cat messages are as below. main issue
UnsatisfiedLinkError. I am trying this on donut release. I will try
the debugging methods you suggested but was wondering if you had a
quick tip on this ?
12-16 15:57:28.454: WARN/dalvikvm(909): threadid=3: thread exiting
with uncaught exception (group=0x4001aa28)
12-16 15:57:28.454: ERROR/AndroidRuntime(909): Uncaught handler:
thread main exiting due to uncaught exception
12-16 15:57:28.474: ERROR/AndroidRuntime(909):
java.lang.UnsatisfiedLinkError: stringFromJNI
12-16 15:57:28.474: ERROR/AndroidRuntime(909): at
com.example.hellojni.ServiceApp.stringFromJNI(Native Method)
12-16 15:57:28.474: ERROR/AndroidRuntime(909): at
com.example.hellojni.ServiceApp.onStart(ServiceApp.java:69)
12-16 15:57:28.474: ERROR/AndroidRuntime(909): at
android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2776)
12-16 15:57:28.474: ERROR/AndroidRuntime(909): at
android.app.ActivityThread.access$3400(ActivityThread.java:116)
Regards,
kcr