如何防止以下两个警告生成停止构建过程的错误?
-compile:
[javac] Compiling 77 source files to /Users/andev/Workspace/android/products/myproject/1.0/Facebook/bin/classes
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] error: warnings found and -Werror specified
[javac] 1 error
[javac] 3 warnings
Run Code Online (Sandbox Code Playgroud)
mat*_*ash 21
另一种可能性(将为使用Ant制作的所有 Android版本修复它)是调整-compile任务的默认参数<android-sdk>\tools\ant\build.xml.
在该<!-- compilation options -->部分,您可以设置编译器标志:
<property name="java.compilerargs" value="-Xlint:-options" />
Run Code Online (Sandbox Code Playgroud)
或者,更改源和目标参数:
<property name="java.target" value="1.6" />
<property name="java.source" value="1.6" />
Run Code Online (Sandbox Code Playgroud)
截至目前,1.6足以避免警告.
| 归档时间: |
|
| 查看次数: |
23847 次 |
| 最近记录: |