I am naive in android ndk right now . i tried steps given in this url: https://www3.ntu.edu.sg/home/ehchua/programming/android/Android_NDK.html
According to this i import sample of HELLO_JNI in my eclipse from android ndkr_10 and when i ran it throws error in logcat given below
08-17 18:12:01.472: E/AndroidRuntime(1269): java.lang.UnsatisfiedLinkError: Couldn't load hello-jni from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.hellojni-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.hellojni-2, /vendor/lib, /system/lib]]]: findLibrary returned null
can somebody help me sort this problem
where i miss?
Thanks in advance
Your error mean that no hello-jni lib was found. The tutorial you follow says that you should have myjni lib.
After compiling your projet to an apk you can run the command line unzip -l you_apk_file. In the list of file you should see your .so file.
Related
I'm trying use SimpleAudioEngine in my project. I include the SimpleAudiEngine header to AppDelegate.
#include "SimpleAudioEngine.h"
When I build my project for Android everything compiles and build is fine. SimpleAudioEngine working is correct.
If run build for Linux, I get an error message:
fatal error: SimpleAudioEngine.h: No such file or directory
#include "SimpleAudioEngine.h"
I tried include SimpleAudioEngine to CMake file - result remains the previous.
I solved the problem by adding this line of code to CMakeLists.txt (in cocos2D version 3.4 project):
${COCOS2D_ROOT}/cocos/audio/include
So CMakeLists.txt is somthing like this now:
...
include_directories(
/usr/local/include/GLFW
...
${COCOS2D_ROOT}/cocos/audio/include
)
hope this help.
I tried to compile devkermit c source using ndk .I am getting the following error while running the binary in boardCANNOT LINK EXECUTABLE: ****cannot locate symbol "signal" referenced by "./devkermit"...
Please Help me.
When I try to build my android project with JNI, with Android NDK r9. I can not build the project and come to this error.
dirname: opérande manquant Saisissez « dirname --help » pour plus d'informations. /bin/sh: 1: ndk-build: not found /bin/sh: 1: ndk-build: not found
This message indicates that my project is not built properly
I don't speak french, but from what I read you have to add the ndk installation directory to your path. Something like
export PATH=$PATH:<path/to/your/ndk/>
I suggest reading https://developer.android.com/tools/sdk/ndk/index.html#GetStarted
I'm trying to add some native code to my android project.
But got problem with gnustl_shared library:
E/AndroidRuntime: Caused by: java.lang.UnsatisfiedLinkError: Couldn't
load gnustl_shared: findLibrary returned null
I have libgnustl_shared.so in libs directory, so I have no idea how to solve the problem. I'm using android studio. Can it be ide's problem?
Load library from libs folder by following code :
static
{
System.loadLibrary("gnustl_shared");
}
Put above code in .java file where native function declaration is given
I got following error while build Android-ndk Please help me.
Cygwin.bat
#echo off
set IS_UNIX=
set DEV_ROOT=C:/iliu-Android-NDK-Fibonacci-a546a1a
set JAVA_HOME=C:/Program Files/Java/jre6/bin
set CLASSPATH=C:/iliu-Android-NDK-Fibonacci-a546a1a/obj
set PATH=D:/new_eclipse/android-sdk-windows/android-sdk-windows/tools;D:/new_eclipse/android-sdk-windows/android-sdk-windows/android-ndk-r7
set ANDROID_NDK_ROOT=/cygdrive/d/new_eclipse/android-sdk-windows/android-sdk-windows/android-ndk-r7
set NDK_PROJECT_PATH=/cygdrive/C/iliu-Android-NDK-Fibonacci-a546a1a
C:
chdir C:/cygwin/bin
bash --login -i
**Error:**
$ ./ndk-build
Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
/cygdrive/d/new_eclipse/android-sdk-windows/android-sdk-windows/android-ndk-r7/build/core/build-local.mk:102: *** Android NDK: Aborting . Stop.
I got following error while build Android-ndk
Please help me.
You have to call ndk-build from your project directory, so in pseudocode,
cd $MyProject
$NDK/ndk-build
you should call ndk from the of your project
like that :
C:\Users\Xhunter\AndroidStudioProjects\mupdf\platform\android\viewer>C:\Users\Xhunter\Downloads\ndk\ndk\ndk-build