简体   繁体   中英

Error while executing process …/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null

Why do I get next error? ps there is no any ndk-build folder at ndk-bundle what does it mean?

Build command failed.


Error while executing process /home/user/Android/Sdk/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/home/user/JNI/app/src/main/jni/Android.mk NDK_APPLICATION_MK=/home/user/JNI/app/src/main/jni/Application.mk APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=1 APP_PLATFORM=android-23 NDK_OUT=/home/user/JNI/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/home/user/JNI/app/build/intermediates/ndkBuild/debug/lib APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}

in my ~/.bashrc I have next:

export NDK=/home/user/Android/Sdk/ndk-bundle
export PATH=$PATH:$NDK
export PATH=$PATH:/home/user/Android/Sdk

UPDATE

from TERMINAL:

user@user-X556UQK:~/Android/Sdk/ndk-bundle$ ndk-build NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/home/user/Android/AndroidStudioProjects/JNIINVOKEFFMPEG1/app/src/main/jni/Android.mk NDK_APPLICATION_MK=/home/user/Android/AndroidStudioProjects/JNIINVOKEFFMPEG1/app/src/main/jni/Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-23 NDK_OUT=/home/user/Android/AndroidStudioProjects/JNIINVOKEFFMPEG1/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/home/user/Android/AndroidStudioProjects/JNIINVOKEFFMPEG1/app/build/intermediates/ndkBuild/debug/lib APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n
Android NDK: /home/user/Android/AndroidStudioProjects/JNIINVOKEFFMPEG1/app/src/main/jni/Android.mk: Cannot find module with tag 'ffmpeg/android/arm' in import path    
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?    
Android NDK: The following directories were searched:    
Android NDK:         
/home/user/Android/AndroidStudioProjects/JNIINVOKEFFMPEG1/app/src/main/jni/Android.mk:14: *** Android NDK: Aborting.    .  Stop.

So the bottom line is, when you see this message in Android Studio,

Error while executing process …/ndk-bundle/ndk-build with arguments {…}

and you don't know what really caused the error, you should try to run exactly same command with exactly same arguments in terminal. The output may give you a reasonable hint.

Specifically in this case, the error message from Android NDK explained which file ( /home/user/Android/AndroidStudioProjects/JNIINVOKEFFMPEG1/app/src/main/jni/Android.mk ) and which line ( 14 ) was in trouble, and even explains what you can do to fix:

define NDK_MODULE_PATH in your environment to let NDK find the module ffmpeg/android/arm

This solution will work in android studio.

In packages,select the folder which has ndk files , delete the intermediates generated (including .build and .externalndkbuild)and clean the project if requires try invalidate cache and restart in android studio

Launched in the terminal. Got this answer:

Android NDK: Could not find application project directory!

Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.

As a result, the reason was Maximum Path Length Limitation (260 characters).

By adding this code to build.gradle (app), the project builds:

allprojects {
 if (Os.isFamily (Os.FAMILY_WINDOWS)) {
     buildDir = "$ {projectDir} /../../../../ build"
 }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM