未能对带有一个机器人工作室项目的命令行构建与摇篮:Xlint错误 [英] Failure on build with Gradle on command line with an android studio project : Xlint error

查看:140
本文介绍了未能对带有一个机器人工作室项目的命令行构建与摇篮:Xlint错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试用摇篮与此命令建立一个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:

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

这篇关于未能对带有一个机器人工作室项目的命令行构建与摇篮:Xlint错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆