android studio 中未配置 NDK 的问题 [英] NDK is not configured issue in android studio
问题描述
我的应用程序在 Eclipse 上构建成功,但在 android studio 上构建失败.它返回错误代码 Ndk 未配置.然后我将 ndk
路径添加到 build.gradle
然后它显示以下错误:
My Application is built successfully on Eclipse but fails to Build on android studio.
It returns the error code Ndk is not Configured.
Then I've added ndk
path to build.gradle
then its showing the following error:
Information:Gradle tasks [:nano:assembleDebug]
WARNING [Project: :nano] Current NDK support is deprecated. Alternative will be provided in the future.
:nano:preBuild UP-TO-DATE
:nano:preDebugBuild UP-TO-DATE
:nano:compileDebugNdk
make.exe: *** No rule to make target `C:\Users\admin\nano\nano\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/la_audio_processing_android/C_\Users\admin\nano\nano\src\main\jni', needed by `C:\Users\admin\nano\nano\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/la_audio_processing_android/C_\Users\admin\nano\nano\src\main\jni\LA_PostProcessing.o'. Stop.
Error:Execution failed for task ':nano:compileDebugNdk'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\admin\AppData\Local\Android\ndk\ndk-build.cmd'' finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 3.449 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
推荐答案
这是Android Studio用户在Windows环境下面临的问题.首先是 NDK 未配置问题
This is the problem faced by Android studio users in Windows environment. First for NDK not Configured problem
转到 local.properties
文件并给出 ndk
路径...例如:
Go to local.properties
file and give ndk
path...
for ex :
#Wed Mar 18 14:10:33 IST 2015
sdk.dir=C\:\\Users\\admin\\AppData\\Local\\Android\\sdk1
ndk.dir=C\:\\Users\\admin\\AppData\\Local\\Android\\ndk
然后对于下一个问题或错误...
Then for the Next Problem or Error...
转到 JNI 文件夹并创建一个任意名称的空 c 文件...那么你的问题就迎刃而解了...
Goto JNI Folder and create an empty c file by any name... Then your problem will be solved...
关于此的一些快速链接是http://ph0b.com/android-studio-gradle-and-ndk-整合/和https://code.google.com/p/android/issues/detail?id=66937
Some Quick links about this are http://ph0b.com/android-studio-gradle-and-ndk-integration/ And https://code.google.com/p/android/issues/detail?id=66937
这篇关于android studio 中未配置 NDK 的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!