Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My NDK project fails to compile with a CPU architecture-related issue

Can someone explain why I get this errors please?

Build command failed.


Error while executing process C:\Users\Kevin\Desktop\Android\Sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Kevin\Desktop\Mygame\proj.android-studio\app\jni\Android.mk NDK_APPLICATION_MK=C:\Users\Kevin\Desktop\Mygame\proj.android-studio\app\jni\Application.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=1 APP_PLATFORM=android-14 NDK_OUT=C:/Users/Kevin/Desktop/Mygame/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\Users\Kevin\Desktop\Mygame\proj.android-studio\app\build\intermediates\ndkBuild\debug\lib NDK_TOOLCHAIN_VERSION=4.9 APP_PLATFORM=android-10 NDK_MODULE_PATH=C:/Users/Kevin/Desktop/Mygame/cocos2d;C:/Users/Kevin/Desktop/Mygame/cocos2d/cocos;C:/Users/Kevin/Desktop/Mygame/cocos2d/external -j4 NDK_DEBUG=1 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.
Build command failed.


Error while executing process C:\Users\Kevin\Desktop\Android\Sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Kevin\Desktop\Mygame\proj.android-studio\app\jni\Android.mk NDK_APPLICATION_MK=C:\Users\Kevin\Desktop\Mygame\proj.android-studio\app\jni\Application.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=0 APP_PLATFORM=android-14 NDK_OUT=C:/Users/Kevin/Desktop/Mygame/proj.android-studio/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=C:\Users\Kevin\Desktop\Mygame\proj.android-studio\app\build\intermediates\ndkBuild\release\lib NDK_TOOLCHAIN_VERSION=4.9 APP_PLATFORM=android-10 NDK_MODULE_PATH=C:/Users/Kevin/Desktop/Mygame/cocos2d;C:/Users/Kevin/Desktop/Mygame/cocos2d/cocos;C:/Users/Kevin/Desktop/Mygame/cocos2d/external -j4 NDK_DEBUG=0 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.

I leave here a screenshot of my android studio if can be helpful enter image description here

like image 736
Kevinddn99 Avatar asked May 14 '18 17:05

Kevinddn99


People also ask

How do you fix NDK bundle did not have a source properties file?

I had the same issue and solve it : Go to SDK location find NDK folder and check the folders if one of them is empty or corrupted delete it and let the android studio use the latest version you have. That was the working one.

How do I fix NDK missing a platforms directory?

It is currently set to /usr/local/opt/android-sdk/ndk-bundle. If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local. properties to remove this warning.

What is NDK path?

Using Android Studio: the possible way to find is using Android Studio. Open your Android Studio Preference (or "File->Settings") > Appearance & Behavior > System Settings > Android SDK. You can find the path to your SDK and NDK, which is in the same directory.


2 Answers

I got this error recently - the cause was a mystery and still is. I reinstalled everything, but I could not get my project to Clean.

In the end I manually deleted the app/build and app/.externalNativeBuild folders, and the project rebuilt fine, and I was then able to run Clean without errors again.

like image 121
Al. Avatar answered Sep 25 '22 07:09

Al.


Most likely, you have NDK r17 installed, which does not support armeabi anymore. Your gradle plugin is not aware of this recent change. You must upgrade: in build.gradle, you should have

buildscript { dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
} }

and in gradle/wrapper/gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

But even after upgrade, your build.gradle most likely lacks the abiFilters statement, and therefore your project build is slower and APK larger than necessary.

You probably only need on ABI in your APK,

android { defaultConfig { ndk {
    abiFilters 'armeabi-v7a'
} } }
like image 39
Alex Cohn Avatar answered Sep 22 '22 07:09

Alex Cohn