I got following error while build Android NDK - android-ndk

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

Related

I set ANDROID_NDK_HOME but it keep says not set correctly

pedrojung#pedroui-MacBookPro MediaPipeUnityPlugin-master2 % echo $ANDROID_HOME
/Users/pedrojung/Library/Android/sdk
pedrojung#pedroui-MacBookPro MediaPipeUnityPlugin-master2 % echo $ANDROID_NDK_HOME
/Users/pedrojung/Library/Android/sdk/ndk
what is weird is that
on setting android_ndk_home
pedrojung#pedroui-MacBookPro MediaPipeUnityPlugin-master2 % export ANDROID_NDK_HOME =/Users/pedrojung/Library/Android/sdk/ndk
zsh: /Users/pedrojung/Library/Android/sdk/ndk not found
it says idk folder is not found but it exist.
anyway, echo command says ANDROID_NDK_HOME is set.
ANDROID_NDK_HOME is located just same folder of ANDROID_HOME with only difference of idk folder...
error is.
Analysis of target '//mediapipe_api:mediapipe_proto_srcs' failed; build aborted: Could not read RELEASE.TXT in Android NDK: /Users/pedrojung/Library/Android/sdk/ndk/RELEASE.TXT (No such file or directory) Unable to read the Android NDK at /Users/pedrojung/Library/Android/sdk/ndk, the path may be invalid. Is the path in android_ndk_repository() or ANDROID_NDK_HOME set correctly? If the path is correct, the contents in the Android NDK directory may have been modified.
from above error , I can get android_ndk is not set correctly.
how can I set android_ndk correctly...?
I'm using m1 MacBook.
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
pedrojung#pedroui-MacBookPro MediaPipeUnityPlugin-master2 % cd $ANDROID_NDK_HOME
pedrojung#pedroui-MacBookPro ndk % ls
21.4.7075529 22.1.7171670 23.0.7599858
I checked path again, and yes it really has ndk.
and I installed ndk through android studio 's SDK manager.

Pointing Android Studio to specific cmake version

I use Android Studio 4.0.1
In my project, my local.properties has the following properties:
sdk.dir=C\:\\Users\\xxx\\AppData\\Local\\Android\\Sdk
ndk.dir=c\:\\yyy\\tools\\android-ndk-r19c
cmake.dir=c\:\\zzz\\cmake-3.17.0-win64-x64
Despite this, I get a compilation error when I Build -> Rebuild project or Clean project because my CMakeLists.txt begins with cmake_minimum_required(VERSION 3.14.3) and Android Studio uses the CMake included in the Android Studio folder instead of the one I point to in cmake.dir:
CMake Error at CMakeLists.txt:5 (cmake_minimum_required):
CMake 3.14.3 or higher is required. You are running version 3.10.2
-- Configuring incomplete, errors occurred!
See also "C:/Users/xxx/AndroidStudioProjects/E2e/app/.cxx/cmake/debug/x86/CMakeFiles/CMakeOutput.log".
FAILED: build.ninja
ninja: error: rebuilding 'build.ninja': subcommand failed
C:\Users\xxx\AppData\Local\Android\Sdk\cmake\3.10.2.4988404\bin\cmake.exe -HC:\Users\xxx\AndroidStudioProjects\E2e\app\src\main\cpp -BC:\Users\xxx\AndroidStudioProjects\E2e\app\.cxx\cmake\debug\x86
What am I missing for AS to pick up the cmake 3.17 I already installed when I select Rebuild Project or Clean Project?
Notes:
The directory I point to with cmake.dir is valid and being read by AS. If I introduce a typo in the path, AS complains about it.
This problem only occurs when I do Build --> Rebuild project or Clean project. If instead I do Build --> Make project, then AS will pick up the cmake version that I point to in local.properties
Clean Project worked again after deleting .cxx folder
I'm not sure about Android Studio, but you could try editing the project's build.gradle :
android {
externalNativeBuild {
cmake {
path file('CMakeLists.txt')
version '3.24.1'
}
}
}
.... and CMakeLists.txt :
cmake_minimum_required(VERSION 3.24.1)

React native android build fails with NDK error [duplicate]

Can someone explain why I get this errors please?
Build command failed.
Error while executing process C:\Users\Kevin\Desktop\Android\Sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Kevin\Desktop\Mygame\proj.android-studio\app\jni\Android.mk NDK_APPLICATION_MK=C:\Users\Kevin\Desktop\Mygame\proj.android-studio\app\jni\Application.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=1 APP_PLATFORM=android-14 NDK_OUT=C:/Users/Kevin/Desktop/Mygame/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\Users\Kevin\Desktop\Mygame\proj.android-studio\app\build\intermediates\ndkBuild\debug\lib NDK_TOOLCHAIN_VERSION=4.9 APP_PLATFORM=android-10 NDK_MODULE_PATH=C:/Users/Kevin/Desktop/Mygame/cocos2d;C:/Users/Kevin/Desktop/Mygame/cocos2d/cocos;C:/Users/Kevin/Desktop/Mygame/cocos2d/external -j4 NDK_DEBUG=1 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
Android NDK: INTERNAL ERROR: The armeabi ABI should have exactly one `architecture definitions. Found: ''`
process_begin: CreateProcess(NULL, "", ...) failed.
*** Android NDK: Aborting... . Stop.
Build command failed.
Error while executing process C:\Users\Kevin\Desktop\Android\Sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Kevin\Desktop\Mygame\proj.android-studio\app\jni\Android.mk NDK_APPLICATION_MK=C:\Users\Kevin\Desktop\Mygame\proj.android-studio\app\jni\Application.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=0 APP_PLATFORM=android-14 NDK_OUT=C:/Users/Kevin/Desktop/Mygame/proj.android-studio/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=C:\Users\Kevin\Desktop\Mygame\proj.android-studio\app\build\intermediates\ndkBuild\release\lib NDK_TOOLCHAIN_VERSION=4.9 APP_PLATFORM=android-10 NDK_MODULE_PATH=C:/Users/Kevin/Desktop/Mygame/cocos2d;C:/Users/Kevin/Desktop/Mygame/cocos2d/cocos;C:/Users/Kevin/Desktop/Mygame/cocos2d/external -j4 NDK_DEBUG=0 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
Android NDK: INTERNAL ERROR: The armeabi ABI should have exactly one architecture definitions. Found: ''
process_begin: CreateProcess(NULL, "", ...) failed.
*** Android NDK: Aborting... . Stop.
I leave here a screenshot of my android studio if can be helpful
Most likely, you have NDK r17 installed, which does not support armeabi anymore. Your gradle plugin is not aware of this recent change. You must upgrade: in build.gradle, you should have
buildscript { dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
} }
and in gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
But even after upgrade, your build.gradle most likely lacks the abiFilters statement, and therefore your project build is slower and APK larger than necessary.
You probably only need on ABI in your APK,
android { defaultConfig { ndk {
abiFilters 'armeabi-v7a'
} } }
I got this error recently - the cause was a mystery and still is. I reinstalled everything, but I could not get my project to Clean.
In the end I manually deleted the app/build and app/.externalNativeBuild folders, and the project rebuilt fine, and I was then able to run Clean without errors again.

java.lang.UnsatisfiedLinkError at android NDK

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.

fail to build project with ndk

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

Resources