未能对带有一个机器人工作室项目的命令行构建与摇篮:Xlint错误能对、摇篮、命令行、机器人

2023-09-03 21:17:42 作者:占她心侵她城做她王

当我尝试用摇篮与此命令建立一个Android项目:

When I try to build an android project with gradle with this command :

> gradlew clean build assembleRelease

它给了我这个错误:

It gives me this error :

Note: Some input files use or override a deprecated API.  
Note: Recompile with -Xlint:deprecation for details.  
Note: Some input files use unchecked or unsafe operations.  
Note: Recompile with -Xlint:unchecked for details.

我可以建立这个项目,使APK的工作室。

I can build this project and make the APK in Studio.

有没有一种方法来配置摇篮,使编译忽视Xlint通知?

Is there a way to configure Gradle to make a compilation ignoring Xlint notifications ?

或者,我可以用其他参数,使通过命令行的发行与摇篮/ gradlew?

OR, can I use other parameters, to make the release from command-line with gradle/gradlew ?

推荐答案

这是一个很好的警告不是错误,看到完整的皮棉报告,你可以加入这一行build.gradle:

It's a nice warning not error, to see the complete lint report you can add these lines to build.gradle:

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

如果你真的想摆脱这些警告的:

If you really want to get rid of those warnings:

请不要使用去precated API 使用@燮pressWarnings(德precation)