I want to build Gstreamer
source and it needs NDK
.
I am setting SDK Manager
-> Android SDK
-> SDK Tools
-> NDK
install
and I set local.properties
dk:dir="C\:\\Users\\ddd\\AppData\\Local\\Android\\sdk\\ndk-bundle
.
After setting ndk, I try to build it, but execution failed.
Execution failed for task ':app:ndkBuild'. > Process 'command 'C:\Users\ddd\AppData\Local\Android\sdk\ndk-bundle\ndk-build.cmd" finished with non-zero exit value 2
message.
How to set ndk on android?
To find the specific issue, check the Build tab in Android Studio to see which task is failing. For me it was task "cleanNative".
Then run this task manually from Terminal with --debug option.
On Mac or Linux:
./gradlew cleanNative --debug
On Windows:
gradlew cleanNative --debug
From logs, you can then see why it is failing. In my case it was the wrong ABI settings:
10:24:27.140 [QUIET] [system.out] Android NDK: The armeabi ABI is no longer supported. Use armeabi-v7a.
10:24:27.140 [QUIET] [system.out] Android NDK: NDK Application 'local' targets unknown ABI(s): armeabi
10:24:27.140 [ERROR] [system.err] /Users/michal-home/Library/Android/sdk/ndk-bundle/build/core/setup-app.mk:79: *** Android NDK: Aborting . Stop.
10:24:27.140 [QUIET] [system.out] Android NDK: Please fix the APP_ABI definition in /path-to-app/app/src/main/jni/Application.mk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With