I'm trying to build an Android projects which involves NDK: CoolMicApp-Android (already have the latest Android Studio and NDK installed)
I followed the BUILDING note correctly. When the project is loaded in Android Studio, there are some errors:
Build command failed.
Error while executing 'C:\Users\Cipta-NB\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd' with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\src\main\jni\Android.mk NDK_APPLICATION_MK=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\src\main\jni\Application.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=0 APP_PLATFORM=android-16 NDK_OUT=C:/Users/Cipta-NB/StudioProjects/CoolMicApp-Android/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\build\intermediates\ndkBuild\release\lib 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. Open File
The C libs can be built successfully by running this command, though:
ndk-build NDK_APPLICATION_MK=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\src\main\jni\Application.mk NDK_PROJECT_PATH=C:\Users\Cipta-NB\StudioProjects\CoolMicApp-Android\app\src\main
In my laptop, ndk-build is located in C:\Users\Cipta-NB\AppData\Local\Android\Sdk\ndk-bundle. Creating an environment variable called NDK_PROJECT_PATH and restarting Android Studio doesn't solve the problem.
This is the content of local.propertes file in the project directory:
ndk.dir=C:\Users\Cipta-NB\AppData\Local\Android\Sdk\ndk-bundle
sdk.dir=C:\Users\Cipta-NB\AppData\Local\Android\Sdk
And this is the content of Application.mk
APP_ABI := armeabi-v7a
APP_PLATFORM := android-14
Is there any (easy) workaround?
abiFilters
in your build.gradle since you're only building for one abi. – Mikhail Vasilyevndk{abiFilters 'armeabi-v7a'}
insidedefaultConfig
in build.gradle as described here. From your output it is clear that gradle overridesAPP_ABI
and sets it toarmeabi
which is deprecated as pointed out by Michael. – Mikhail Vasilyev