Background
Before tossing:
"Record" in Android Studio import Osmand and compile
During, a compilation warning was encountered:
12345 |
:OsmAnd-java:compileJava 注: E:\crifan\DevRoot\Osmand-master\OsmAnd-java\src\net\osmand\util\GeoPointParserUtil.java使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: 某些输入文件使用了未经检查或不安全的操作。 注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。 |
"Resolution Process"
1. I didn't know how to solve it before. Then there was no effect on the compilation, so it was ignored.
2. Later saw:
Android Studio Series Tutorial Four –gradle basics
In the following:
1234 |
// 移除lint检查的error lintOptions { abortOnError false } |
Guess is that there is a corresponding here in the Build.gradle, you can add lint parameters, estimate the above said:
12 |
-Xlint:deprecation -Xlint:unchecked |
The parameters, perhaps can be put here.
So try it out.
But in the Osmand-java in the Build.gradle did not see that (Android) lintoptions
So, go to the Internet to search this question.
3. Search:
Android Studio Xlint:deprecation
Reference:
How do I add-xlint:unchecked to my Android Gradle based project? –stack Overflow
To add this configuration:
And then to compile and see.
Sure enough, there was no warning:
Summary
When compiling Java-related code in Android studio, a similar warning appears:
- For more information, recompile with-xlint:deprecation.
- For more information, recompile with-xlint:unchecked.
, add the configuration to the Build.gradle of the project:
1234567 |
allprojects { &NBSP;&NBSP;&NBSP;&NBSP; gradle.projectsevaluated { tasks.withtype (javacompile) { Options.compilerargs << "-xlint:unchecked" << "-xlint:deprecation" &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;&NBSP; } } |
You can eliminate the warning.
Android Studio Compiler Osmand Warning: Geopointparserutil.java uses or overwrites outdated APIs. For more information, recompile with-xlint:deprecation