Android NDK jni problem

Posted by Donal Rafferty on Stack Overflow See other posts from Stack Overflow or by Donal Rafferty
Published on 2010-04-08T11:50:15Z Indexed on 2010/04/08 11:53 UTC
Read the original article Hit count: 695

Filed under:
|
|
|
|

I have started teaching myself about the Android NDK and I have followed this example here - http://marakana.com/forums/android/android_examples/49.html

I have followed the steps perfectly but when I run the application I get the following error:

Trying to load lib /data/data/com.cnetworks.ndk/lib/libndk_demo.so 0x435c2d20
Added shared lib /data/data/com.cnetworks.ndk/lib/libndk_demo.so 0x435c2d20
No JNI_OnLoad found in /data/data/com.cnetworks.ndk/lib/libndk_demo.so 0x435c2d20
+++ not scanning '/system/lib/libwebcore.so' for 'hello' (wrong CL)
+++ not scanning '/system/lib/libmedia_jni.so' for 'hello' (wrong CL)
WARN/dalvikvm(5191): No implementation found for native Lcom/cnetworks/ndk/NativeLib;.hello ()Ljava/lang/String;

Here is the java code, nativeLib.hello() is causing the problem.

public class NDKdemo2 extends Activity {
NativeLib nativeLib;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);

 nativeLib = new NativeLib();
 String helloText = nativeLib.hello();

 // Update the UI
 TextView outText = (TextView) findViewById(R.id.textOut);
 outText.setText(helloText);


 }
}

Has anyone had the same problem before and able to tell me whats wrong?

© Stack Overflow or respective owner

Related posts about android-ndk

Related posts about android