源值1.5已过时,将在以后的版本中删除

Som*_*ere 18 android

如何防止以下两个警告生成停止构建过程的错误?

-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足以避免警告.