JNI warning: Illegal class name

1,052 views
Skip to first unread message

Bharath

unread,
Sep 14, 2009, 5:59:10 AM9/14/09
to android-ndk

I am getting error while loading native library.
It says illegal class name com.example.testNative.callNative'

Even after giving ful class name I am getting this error can you
explain me what
caused this problem.

Trying to load lib /data/bharath/libTestNDK.so 0x43593e80
D/dalvikvm( 1226): Added shared lib /data/bharath/libTestNDK.so
0x43593e80
W/dalvikvm( 1226): JNI WARNING: illegal class name
'com.example.testNative.callNative' (Check_FindClass)

Dan Bornstein

unread,
Sep 14, 2009, 8:19:52 PM9/14/09
to andro...@googlegroups.com
On Mon, Sep 14, 2009 at 2:59 AM, Bharath <bharath...@gmail.com> wrote:
> I am getting error while loading native library.
> It says illegal class name com.example.testNative.callNative'

Two things: (1) It looks like you might have a method name there and
not a class name, and (2) it looks like you are using "." as a
separator instead of "/". ("." is Java surface syntax for separating
package names, but "/" is what is used at the API boundary.) So, I
would check to make sure that your JNI registration code is
well-formed.

If this isn't your problem, then maybe you can provide a bit more
context (e.g., actual source code) which might help guide further
suggestions.

-dan

Bharath

unread,
Sep 15, 2009, 12:16:27 AM9/15/09
to android-ndk

Hi Dan,

Thanks a lot this is working for me.
I used "." as a separator instead "/". When I changed this si working
for me.

Thanks a lot.


On Sep 15, 5:19 am, Dan Bornstein <danf...@android.com> wrote:
Reply all
Reply to author
Forward
0 new messages