Issue
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?
Solution
NDK_PROJECT_PATH=null
is a red herring. It only looks alarming. It's not an error. This is how NDK build is configured in Android Studio.The latest NDK r17 dropped support for some ABIs. Unfortunately, the old Gradle plugin does not know that. You can resolve this inconsistency by tuning your build.gradle script, but upgrading the plugin is easier and safer.
Answered By - Alex Cohn
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.