Context
I am using the androidx.legacy.widget.Space
in a layout in an Android application project:
<androidx.legacy.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/space_height" />
The class is marked as @Deprecated
- one should use the framework Space class instead:
// Copied from legacy-support-core-ui-1.0.0-sources.jar/androidx/legacy/widget/Space.java
@deprecated Use framework {@link android.widget.Space} class instead.
Finding usage of deprecated APIs
I ran Inspect Code...
or Run inspection by Name ...
for Java or XML files (see screenshots) in Android Studio 4.2 Canary 7 ...
... and use the compiler arguments when I build via shell command ..
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
... but the deprecated Space
class usage is not reported. How can I detect it (and any other such cases)?
Update 27.08.2020
In Android Studio both the "Deprecated API usage ..." Inspections for Java and XML are activated as shown in the Setting screenshot.
Related
- Where can I find a list of Android features that are deprecated by newer features?
- Display classes containing deprecation Android Studio
- How to add -Xlint:unchecked to my Android Gradle based project?
- How do I compile with -Xlint:unchecked?
- Recompile with -Xlint parameters
- Google issue #157676020: Lint doesn't warn about framework deprecated APIs
- Google issue #163080422: lint.xml: synchronize with IDE, allow directory nesting, support configurations, etc