Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8267625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:36:11+00:00 2026-06-08T05:36:11+00:00

I’m a newbie with the Android NDK and so I hope my question is

  • 0

I’m a newbie with the Android NDK and so I hope my question is not a stupid one.

I followed this tutorial, found on this link:

http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/

Everything worked smoothly, I followed every instruction. However, when I ran the application, it’s giving me these errors in my logcat:

07-20 07:35:25.253: D/dalvikvm(390): Trying to load lib /data/data/com.example.testndk/lib/libndkfoo.so 0x40515310
07-20 07:35:25.253: D/dalvikvm(390): Added shared lib /data/data/com.example.testndk/lib/libndkfoo.so 0x40515310
07-20 07:35:25.253: D/dalvikvm(390): No JNI_OnLoad found in /data/data/com.example.testndk/lib/libndkfoo.so 0x40515310, skipping init
07-20 07:35:25.503: W/dalvikvm(390): No implementation found for native Lcom/example/testndk/NdkFooActivity;.invokeNativeFunction ()Ljava/lang/String;
07-20 07:35:25.513: D/AndroidRuntime(390): Shutting down VM
07-20 07:35:25.513: W/dalvikvm(390): threadid=1: thread exiting with uncaught exception (group=0x40015560)
07-20 07:35:25.534: E/AndroidRuntime(390): FATAL EXCEPTION: main
07-20 07:35:25.534: E/AndroidRuntime(390): java.lang.UnsatisfiedLinkError: invokeNativeFunction
07-20 07:35:25.534: E/AndroidRuntime(390):  at com.example.testndk.NdkFooActivity.invokeNativeFunction(Native Method)
07-20 07:35:25.534: E/AndroidRuntime(390):  at com.example.testndk.NdkFooActivity.onCreate(NdkFooActivity.java:23)
07-20 07:35:25.534: E/AndroidRuntime(390):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-20 07:35:25.534: E/AndroidRuntime(390):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
07-20 07:35:25.534: E/AndroidRuntime(390):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
07-20 07:35:25.534: E/AndroidRuntime(390):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-20 07:35:25.534: E/AndroidRuntime(390):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
07-20 07:35:25.534: E/AndroidRuntime(390):  at android.os.Handler.dispatchMessage(Handler.java:99)
07-20 07:35:25.534: E/AndroidRuntime(390):  at android.os.Looper.loop(Looper.java:123)
07-20 07:35:25.534: E/AndroidRuntime(390):  at android.app.ActivityThread.main(ActivityThread.java:3683)
07-20 07:35:25.534: E/AndroidRuntime(390):  at java.lang.reflect.Method.invokeNative(Native Method)
07-20 07:35:25.534: E/AndroidRuntime(390):  at java.lang.reflect.Method.invoke(Method.java:507)
07-20 07:35:25.534: E/AndroidRuntime(390):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-20 07:35:25.534: E/AndroidRuntime(390):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-20 07:35:25.534: E/AndroidRuntime(390):  at dalvik.system.NativeStart.main(Native Method)

Does anyone have a slight clue what the issue may be? I’ve tried to figure it out and even started the tutorial from scratch, however the problem persists. Thanks in advance.

My Android java code:

package com.example.testndk;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;

public class NdkFooActivity extends Activity {

      // load the library - name matches jni/Android.mk 
      static {
        System.loadLibrary("ndkfoo");
      }

      // declare the native code function - must match ndkfoo.c
      private native String invokeNativeFunction();

      @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);

            // this is where we call the native code
            String hello = invokeNativeFunction();

            new AlertDialog.Builder(this).setMessage(hello).show();
        }

}

C source code:

#include <string.h>
#include <jni.h>

jstring Java_com_mindtherobot_samples_ndkfoo_NdkFooActivity_invokeNativeFunction(JNIEnv* env, jobject javaThis) {
  return (*env)->NewStringUTF(env, "Hello from native code!");
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:36:14+00:00Added an answer on June 8, 2026 at 5:36 am

    You have java.lang.UnsatisfiedLinkError because, may be the c function name didn’t match the fully qualified name of your java class. Check in ndkfoo.c to match the package and class name of the target java class:

    jstring Java_com_mindtherobot_samples_ndkfoo_NdkFooActivity_invokeNativeFunction(JNIEnv* env, jobject javaThis)

    This should be:

    jstring Java_com_example_testndk_NdkFooActivity_invokeNativeFunction(JNIEnv* env, jobject javaThis)

    or change the package name in your java project to: package com.mindtherobot.samples.ndkfoo;

    Then you need to click [Project]->[Clean] before you test so eclipse knows it has to recompile.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.