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 9008609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:58:52+00:00 2026-06-16T01:58:52+00:00

I create an android project(TestJni) in the android source path /packages/apps/ without eclipse. I

  • 0

I create an android project(TestJni) in the android source path /packages/apps/ without eclipse. I had compiled the android source code.

I had added the jni folder . Under the jni folder, there are some files ,including Android.mk and basic.c .

Android.mk

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := basic.c
LOCAL_MODULE := testjni
include $(BUILD_SHARED_LIBRARY)

basic.c

#include<string.h>
#include<jni.h>
jstring Java_com_example_FristJniActivity_getStringFromJni(JNIEnv *env, jobject thiz) {
    return (*env)->NewStringUTF(env, "hello ndk and jni");
}

root of current android Project, there is a Android.mk
Android.mk

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := TestJni
LOCAL_JNI_SHARD_LIBRARIES := testjni
LOCAL_REQUIRED_MODULES := testjni
include $(BUILD_PACKAGE)

in src folder,there is a activity(FristJniActivity)
FristJniActivity.java

static {
    System.loadLirary("testjni");
}
public native String getStringFromJni();

public void onCreate(Bundle b) {
    super.onCreate(b);
    TextView tv = new TextView(this);
    tv.setText(getStringFromJNi());
    setContentView(tv);
}

Then I compile the TestJni app, and the apk can be found.But after I push it into the handset, force close .

The error is :
java.lang.unsatisfiedlinkerror:couldn’t load testjni: findLibrary returned null

I googled . But I can’t find the solution.

I had checked the apk file, the testjni.so file is already exist in the /lib/armeabi-v7a/ directory.

  • 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-16T01:58:53+00:00Added an answer on June 16, 2026 at 1:58 am

    I modify some values

    jni/Android.mk

    LOCAL_MODULE := libtestjni
    

    Android.mk

    LOCAL_JNI_SHARD_LIBRARIES := libtestjni
    LOCAL_REQUIRED_MODULES := libtestjni
    

    , and use the command “adb install *.apk “.

    Then it works well.

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

Sidebar

Related Questions

I am trying to create an android project using eclipse IDE,its created successfully but
When I create an Android project in Eclipse and send it to my device
When I create a new Android Sample Project from eclipse with api level 14,
I'm not able to create a new android project in eclipse. Whenever I try
When I create basic Android project on eclipse I can press debug button and
Whenever I create a new Android project in Eclipse, it shows an error in
When I create a new Android project in Eclipse, the following default proguard.cfg file
hi i have to create one new android project on my eclipse means am
When trying to create a new Android Project with Eclipse, there is no Build
How do I create an Android Test project in Eclipse in the target project's

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.