lintOptions为Android Studio中1.3实验摇篮构建工具 [英] lintOptions for experimental Gradle build tool in Android Studio 1.3
问题描述
由于Android的工作室1.3 NDK支持来,我试图转换下面这个链接的 http://tools.android.com/tech-docs/new-build-system/gradle-experimental
As Android Studio 1.3 coming with NDK support, I tried to convert my Gradle scripts (build.gradle app/build.gradle and gradle-wrapper.properties) following this link http://tools.android.com/tech-docs/new-build-system/gradle-experimental.
不过,我无法找到的 lintOptions 无论从任何教程指导和NDK例如资料库的 https://github.com/googlesamples/android-ndk
However, I cannot find any guidance about lintOptions from both the tutorial as well as ndk example repository https://github.com/googlesamples/android-ndk
我的应用程序/的build.gradle
My app/build.gradle
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion = 21
buildToolsVersion = "21.1.2"
defaultConfig.with {
applicationId = "com.abc.xyz"
minSdkVersion.apiLevel = 9
targetSdkVersion.apiLevel = 21
}
compileOptions.with {
sourceCompatibility=JavaVersion.VERSION_1_7
targetCompatibility=JavaVersion.VERSION_1_7
}
lintOptions { // <-- this block
checkReleaseBuilds false
}
}
android.buildTypes {
release {
minifyEnabled = true
}
}
}
同步失败,日志中:错误:原因:com.android.build.gradle.managed.AndroidConfig_Impl
The sync failed with log: Error:Cause: com.android.build.gradle.managed.AndroidConfig_Impl
如果我删除 lintOptions 块,它似乎同步正常,但后来构建失败。
If I remove the lintOptions block, it seems to sync OK but build fails later.
推荐答案
这应该是pfixed $ P $机器人。模型内部{}
It should be prefixed with "android." inside the model{ }
model{
android.lintOptions {
checkReleaseBuilds = false
}
}
这篇关于lintOptions为Android Studio中1.3实验摇篮构建工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!