Error occurred executing external native build for ndkBuild in android studio

六月ゝ 毕业季﹏ 提交于 2019-12-12 10:25:55

问题


I used coolMic repofor broadcasting audio from android device.

But When i import it in android studio i got following error:-

E:\New folder (2)\CoolMicApp-Android\app\build.gradle
Error:executing external native build for ndkBuild E:\New folder (2)\CoolMicApp-Android\app\src\main\jni\Android.mk
Error:executing external native build for ndkBuild E:\New folder (2)\CoolMicApp-Android\app\src\main\jni\Android.mk

I checked on some resources but not help to resolve this. Also From coolMic document where i follow the steps:-

How to build coolmic:
1. Download Android Studio and the NDK
2. Clone this repository
3. Run the following commands:
$ git submodule init
$ git submodule update --init --recursive
4. Import the Project into Android Studio. Select gradle-wrapper. 
5. Hit build(Arrovdown with 011001 next to it. 
6. Hit the Build Menu and then Build APK
7. You can find the resulting APK under ./app/build/outputs/apk/

回答1:


This error only occurs when your project location path is having a folder name that contains white-space.

For ex.

-> Problem path :- D:\Android Project\ProjectName\app\jni\android.mk

In the problem path, folder name has with whitespace like "Android Project"

=================================

-> Solution path :- D:\Android_Project\ProjectName\app\jni\android.mk

In the solution path, folder name does not have any whitespace like "Android_project"




回答2:


Finally i resolved the issue. There is warning when you create new project in android studio with c or c++:-

Project location should not contain any white-space this cause problem with Ndk tools

I completely missed this.as my location E:\New folder(2)\New so just change my path everything works fine



来源:https://stackoverflow.com/questions/46348000/error-occurred-executing-external-native-build-for-ndkbuild-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!