Hello all,

Learning about the NDK and JNI today.  I was able to build, install
and run the Quake demo that was ported to Android via the NDK 1.6.
Worked great.

I then started looking at the hello-jni example.  This example works
for me in the emulator, but does NOT work for me on the G1:

I/ActivityManager(   76): Start proc com.example.hellojni for activity
com.example.hellojni/.HelloJni: pid=508 uid=10030 gids={1015}
I/jdwp    (  508): received file descriptor 20 from ADB
W/dalvikvm(  508): Exception Ljava/lang/UnsatisfiedLinkError; thrown
during Lcom/example/hellojni/HelloJni;.<clinit>
W/dalvikvm(  508): Class init failed in newInstance call
(Lcom/example/hellojni/HelloJni;)
D/AndroidRuntime(  508): Shutting down VM
W/dalvikvm(  508): threadid=3: thread exiting with uncaught exception
(group=0x4001da28)
E/AndroidRuntime(  508): Uncaught handler: thread main exiting due to
uncaught exception
E/AndroidRuntime(  508): java.lang.ExceptionInInitializerError
E/AndroidRuntime(  508):        at java.lang.Class.newInstanceImpl(Native 
Method)
E/AndroidRuntime(  508):        at java.lang.Class.newInstance(Class.java:1472)
E/AndroidRuntime(  508):        at
android.app.Instrumentation.newActivity(Instrumentation.java:1097)
E/AndroidRuntime(  508):        at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)
E/AndroidRuntime(  508):        at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
E/AndroidRuntime(  508):        at
android.app.ActivityThread.access$2100(ActivityThread.java:116)
E/AndroidRuntime(  508):        at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
E/AndroidRuntime(  508):        at 
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  508):        at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  508):        at
android.app.ActivityThread.main(ActivityThread.java:4203)
E/AndroidRuntime(  508):        at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  508):        at 
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(  508):        at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime(  508):        at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
E/AndroidRuntime(  508):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(  508): Caused by: java.lang.UnsatisfiedLinkError:
Library hello-jni not found
E/AndroidRuntime(  508):        at 
java.lang.Runtime.loadLibrary(Runtime.java:489)
E/AndroidRuntime(  508):        at java.lang.System.loadLibrary(System.java:557)
E/AndroidRuntime(  508):        at
com.example.hellojni.HelloJni.<clinit>(HelloJni.java:64)
E/AndroidRuntime(  508):        ... 15 more
I/Process (   76): Sending signal. PID: 508 SIG: 3
I/dalvikvm(  508): threadid=7: reacting to signal 3


This seems to be clearly because the loading of the library hello-jni
library is failing in the static initializer block inside
HelloJni.java.  The apk does include the .so file
(libs/armeabi/libhello-jni.so) and as I said, this example does work
on the emulator.  The apk also worked on another device (which had
Cupcake installed).

I am using Donut (SDK 1.6 r1 and NDK 1.6 r1).  The Android app was set
to have API level 4 in Eclipse.

Any pointers appreciated,
Jeff Schiller

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to