忽略过时信息

来源:互联网 发布:mac如何输入emoji 编辑:程序博客网 时间:2024/06/02 03:57

在打包时你可能遇到这样的问题:

警告: [deprecation] android.hardware中的Camera已过时

对于打包没什么影响

解决方式:

在module下的gradle加入了:

android{

lintOptions {
checkReleaseBuilds false
abortOnError false
}

allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}

}




Error:Execution failed for task ':app:javaPreCompileDebug' 错误Error:Execution failed for task ':app:javaPreCompileDebug'.

> Annotation processors must be explicitly declared now.  The following dependencies on the compile classpath are found to contain annotation processor.  Please add them to the annotationProcessor configuration.
    - butterknife-6.0.0.jar (com.jakewharton:butterknife:6.0.0)
  Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior.  Note that this option is deprecated and will be removed in the future.

  See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details.

在app的build中
android {
    ...
    defaultConfig {
        ...
        //添加如下配置就OK了
        javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
    }
    ...
}



原创粉丝点击