How to recompile with -Xlint:deprecated

3,000 views
Skip to first unread message

Andreas Falkenhahn

unread,
Apr 9, 2018, 9:20:24 AM4/9/18
to andro...@googlegroups.com
I don't use Android Studio but I build everything from the command line using build.gradle. I generate a Lint report like this:

./gradlew lint

This correctly generates a Lint report but it also says this:

Note: MyActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

This makes me wonder how I can do that? I've tried the following:

./gradlew lint -Xlint:deprecation

But it doesn't work. It says:

Problem configuring task :app:lint from command line.
Unknown command-line option '-X'.

So how can I pass -Xlint:deprecation to Lint via gradle?

--
Best regards,
Andreas Falkenhahn mailto:and...@falkenhahn.com

Alex Cohn

unread,
Apr 9, 2018, 4:32:32 PM4/9/18
to android-ndk
Please check this answer on SO. TL;NR: set relevant options.compilerFlags in your build.gradle.

Cheers,
Alex

Andreas Falkenhahn

unread,
Apr 12, 2018, 1:58:11 PM4/12/18
to Alex Cohn
Thanks!
Reply all
Reply to author
Forward
0 new messages