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