The step is: 1.Register method for class A,call env->RegisterNatives(env,"com/test/ A",aMethods,sizeof(medthods). It succeeded. 2.Register method for class B. The error happened here when call env- >RegisterNatives(env,"com/test/A$B",bMethodssizeof(medthods).
On 7月7日, 上午1时46分, fadden <[email protected]> wrote: > The way you wrote that in this message, and the way the error reads, > your native_ClassInit method is part of A, not A$B. > > The error message is generated by the VM when it's trying to find a > native method for A.native_ClassInit, not when you do the > registration. Are you sure the registration call is returning JNI_OK? > > On Jul 6, 5:54 am, wu tony <[email protected]> wrote: > > > > > class A{ > > static { > > System.loadLibrary("test");}; > > > ... > > public B() > > {} > > > private native static void native_ClassInit(); > > > } > > > When try to register using > > env->RegisterNatives(env,"com/test/A$B",bMethodssizeof(medthods) > > /sizeof(medthods[0])); > > > I got the following error: > > > Error info: > > No implementation found for native Lcom/test/A;.native_ClassInit ()V > > Who knows how to do it?- 隐藏被引用文字 - > > - 显示引用的文字 - --~--~---------~--~----~------------~-------~--~----~ unsubscribe: [email protected] website: http://groups.google.com/group/android-porting -~----------~----~----~----~------~----~------~--~---
