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

首先贴上编译错误的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













评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值