Android–Gradle build finished with 232 error(s) in 1m 43s
What is this?(这是啥?)
这些很多可能性是我们在Android 的开发过程中使用了过时的javaAPI,或者不太规范的编程,所以这232个error,其实是232个warnings, 所以如果我们可以编译通过,就代表并没有什么错,我们可以使用以下几种方式解决1
解决方法
以下都是在Gradle中加
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
//Bmob的maven仓库地址--必填
maven { url "https://raw.github.com/bmob/bmob-android-sdk/master" }
gradle.projectsEvaluated {
tasks.withType(JavaCompile){
options.compilerArgs << "-Xmaxerrs" << "1000"
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
1. 加入下列代码,把最大Error数调大
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xmaxerrs" << "1000"
}
}
2. 加入下列代码,不检查warning
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}