anta40
anta40

Reputation: 6743

NDK_PROJECT_PATH=null on Android Studio 3.1.2

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?

Upvotes: 9

Views: 25943

Answers (1)

Alex Cohn
Alex Cohn

Reputation: 57203

  1. 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.

  2. 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.

Upvotes: 7

Related Questions