Error Building Andoid NDK in Android Studio

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Error Building Andoid NDK in Android Studio



This is my first time using Native NDK in Android Studio.
The project I'm trying to add can be found here : https://github.com/timsu/android-aac-enc


Native NDK


Android Studio



I followed this guide to install NDK and everything related. Then I added the jni folder to the appsrcmainjni and added this line to build.gradle.


NDK


jni folder


appsrcmainjni


build.gradle


android {
externalNativeBuild {
ndkBuild {
path "src/main/jni/Android.mk"
}
}



When I try to sync the project I get the following error :


error


Build command failed.

Error while executing process C:UsersThermalTake i7AppDataLocalAndroidSdkndk-bundlendk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:UsersThermalTake i7DesktopStarMe Gitstarme_android-codeappsrcmainjniAndroid.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-19 NDK_OUT=C:/Users/ThermalTake i7/Desktop/StarMe Git/starme_android-code/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:UsersThermalTake i7DesktopStarMe Gitstarme_android-codeappbuildintermediatesndkBuilddebuglib APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
'C:UsersThermalTake' is not recognized as an internal or external command,
operable program or batch file.



After searching for some answers I tried adding this line to the build.gradle:


build.gradle


android {
defaultConfig
{
ndk {
abiFilters 'armeabi-v7a'
}
}



And still got the same error, what am I missing?
Is adding the jni folder all that I have to do?


jni





I would like to suggest you use cmake tool chain rather than the deperecated NDK closure
– shizhen
15 hours ago





As I have understood Cmake requires the .txt file to load but this project has Android.mk
– kataroty
15 hours ago


Android.mk





yes, android.mk was old way for Android native build, and now CMake is recommended for new Android native project
– shizhen
10 hours ago





I provided a link to the project I'm trying to use and it has Android.mk, how can I convert it or what should i do with that?
– kataroty
10 hours ago


Android.mk




1 Answer
1



The error message seems to indicate the build is trying to execute


C:UsersThermalTake



Rather than your intended file.



Typically this is due to white space being in the path. Two options are wrap the path using " characters or escape the white space (for windows try using the '^' character).





Well the path comes from Android.mk where is says LOCAL_PATH := $(call my-dir) and thus it gets the white space. Can I change something there?
– kataroty
15 hours ago


Android.mk


LOCAL_PATH := $(call my-dir)





This was the error but I dont get the part where you say to wrap the path or escape since I am using $(call my-dir) as mentioned previously.
– kataroty
26 mins ago


$(call my-dir)






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Stripe::AuthenticationError No API key provided. Set your API key using “Stripe.api_key = ”

CRM reporting Extension - SSRS instance is blank

Keycloak server returning user_not_found error when user is already imported with LDAP