Android studio填坑:Execution failed for task ':app:compileDebugNdk'.异常的处理

来源:互联网 发布:解沉迷软件 编辑:程序博客网 时间:2024/05/23 10:01

首先贴上编译错误的log;

Error:注: Version 2.1.1 of Realm is now available: http://static.realm.io/downloads/java/latest注: Processing class LikeRecordRealm注: Processing class ReadRecordRealm注: Creating DefaultRealmModule注: 某些输入文件使用或覆盖了已过时的 API。注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。注: 某些输入文件使用了未经检查或不安全的操作。注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。FAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:compileDebugNdk'.> NDK not configured.Download the NDK from http://developer.android.com/tools/sdk/ndk/.Then add ndk.dir=path/to/ndk in local.properties.(On Windows, make sure you escape backslashes, e.g. C:\\ndk rather than C:\ndk)* Try:Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.

汉字大家都看的懂,英文也是很容易看的明白的。但是问题来了,怎么解决呢?

大致意思就是说引用的一些ndk资源没有被配置或者说一些安全隐患什么的。需要怎么解决?那就在gradle里面配置呗。。。。。。


配置如下

就是在app/build.gradle中的android里面加上

sourceSets.main {    jni.srcDirs = []}
就可以了


还有个方法:

只需要在项目下的gradle.properties加上这一句就可以了“android.useDeprecatedNdk=true













2 0
原创粉丝点击