Overview
| Lint | |
| 4 | warning ObsoleteLintCustomCheck: Obsolete custom lint check |
| Correctness | |
| 1 | warning FragmentTagUsage: Use FragmentContainerView instead of the <fragment> tag |
| 2 | warning GradleDependency: Obsolete Gradle Dependency |
| 1 | warning GradleDynamicVersion: Gradle Dynamic Version |
| Security | |
| 1 | warning AllowBackup: AllowBackup/FullBackupContent Problems |
| Performance | |
| 1 | warning UnusedResources: Unused resources |
| 3 | warning UnusedIds: Unused id |
| Usability | |
| 1 | warning SelectableText: Dynamic text should probably be selectable |
| 1 | warning GoogleAppIndexingWarning: Missing support for Firebase App Indexing |
| Accessibility | |
| 1 | error
ContentDescription: Image without contentDescription |
| Disabled Checks (1) |
Obsolete custom lint check
../../../../../.gradle/caches/transforms-3/eab42dfe75a616bad2c5600ef62620ac/transformed/jetified-annotation-experimental-1.0.0/jars/lint.jar:
../../../../../.gradle/caches/transforms-3/205b6794ec5ff1601c2c2586e6c01667/transformed/appcompat-1.2.0/jars/lint.jar:
../../../../../.gradle/caches/transforms-3/e68d85c46a11bcf9dcdb748311f94acd/transformed/fragment-1.2.4/jars/lint.jar:
../../../../../.gradle/caches/transforms-3/a8d90b74b6527e1f9c3fac825a19094e/transformed/jetified-lifecycle-runtime-ktx-2.2.0/jars/lint.jar:
../../../../../.gradle/caches/transforms-3/205b6794ec5ff1601c2c2586e6c01667/transformed/appcompat-1.2.0/jars/lint.jar:
../../../../../.gradle/caches/transforms-3/e68d85c46a11bcf9dcdb748311f94acd/transformed/fragment-1.2.4/jars/lint.jar:
../../../../../.gradle/caches/transforms-3/a8d90b74b6527e1f9c3fac825a19094e/transformed/jetified-lifecycle-runtime-ktx-2.2.0/jars/lint.jar:
ObsoleteLintCustomCheck
Warning
Priority 10/10
Use FragmentContainerView instead of the <fragment> tag
../../src/main/res/layout/content_main.xml:8:
5 android:layout_height="match_parent" 6 app:layout_behavior="@string/appbar_scrolling_view_behavior"> 7 8 <fragment 9 android:id="@+id/nav_host_fragment_content_main" 10 android:name="androidx.navigation.fragment.NavHostFragment" 11 android:layout_width="0dp"
FragmentTagUsage
Correctness
Warning
Priority 5/10
Obsolete Gradle Dependency
../../build.gradle:56:
53 implementation 'androidx.appcompat:appcompat:1.2.0' 54 implementation 'com.google.android.material:material:1.3.0' 55 implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 56 implementation 'androidx.navigation:navigation-fragment-ktx:2.3.4' 57 implementation 'androidx.navigation:navigation-ui-ktx:2.3.4' 58 testImplementation 'junit:junit:4.+' 59 androidTestImplementation 'androidx.test.ext:junit:1.1.2'../../build.gradle:57:
54 implementation 'com.google.android.material:material:1.3.0' 55 implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 56 implementation 'androidx.navigation:navigation-fragment-ktx:2.3.4' 57 implementation 'androidx.navigation:navigation-ui-ktx:2.3.4' 58 testImplementation 'junit:junit:4.+' 59 androidTestImplementation 'androidx.test.ext:junit:1.1.2' 60 androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
GradleDependency
Correctness
Warning
Priority 4/10
Gradle Dynamic Version
../../build.gradle:58:
55 implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 56 implementation 'androidx.navigation:navigation-fragment-ktx:2.3.4' 57 implementation 'androidx.navigation:navigation-ui-ktx:2.3.4' 58 testImplementation 'junit:junit:4.+' 59 androidTestImplementation 'androidx.test.ext:junit:1.1.2' 60 androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' 61 }
GradleDynamicVersion
Correctness
Warning
Priority 4/10
AllowBackup/FullBackupContent Problems
../../src/main/AndroidManifest.xml:5:
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 3 package="com.example.myapplication"> 4 5 <application 6 android:allowBackup="true" 7 android:icon="@mipmap/ic_launcher" 8 android:label="@string/app_name"
AllowBackup
Security
Warning
Priority 3/10
Unused resources
../../src/main/res/values/strings.xml:11:
8 <string name="previous">Previous</string> 9 10 <string name="hello_first_fragment">Hello first fragment</string> 11 <string name="hello_second_fragment">Hello second fragment. Arg: %1$s</string> 12 </resources>
UnusedResources
Performance
Warning
Priority 3/10
Unused id
../../src/main/res/layout/activity_main.xml:15:
12 android:theme="@style/Theme.MyApplication.AppBarOverlay"> 13 14 <androidx.appcompat.widget.Toolbar 15 android:id="@+id/toolbar" 16 android:layout_width="match_parent" 17 android:layout_height="?attr/actionBarSize" 18 android:background="?attr/colorPrimary"../../src/main/res/layout/activity_main.xml:24:
21 </com.google.android.material.appbar.AppBarLayout> 22 23 <com.google.android.material.floatingactionbutton.FloatingActionButton 24 android:id="@+id/fab" 25 android:layout_width="wrap_content" 26 android:layout_height="wrap_content" 27 android:layout_gravity="bottom|end"../../src/main/res/navigation/nav_graph.xml:5:
2 <navigation xmlns:android="http://schemas.android.com/apk/res/android" 3 xmlns:app="http://schemas.android.com/apk/res-auto" 4 xmlns:tools="http://schemas.android.com/tools" 5 android:id="@+id/nav_graph" 6 app:startDestination="@id/FirstFragment"> 7 8 <fragment
UnusedIds
Performance
Warning
Priority 1/10
Dynamic text should probably be selectable
../../src/main/res/layout/fragment_second.xml:19:
16 app:layout_constraintStart_toStartOf="parent" 17 app:layout_constraintTop_toBottomOf="@id/textview_second" /> 18 19 <TextView 20 android:id="@+id/textview_second" 21 android:layout_width="wrap_content" 22 android:layout_height="wrap_content"
SelectableText
Usability
Warning
Priority 7/10
Missing support for Firebase App Indexing
../../src/main/AndroidManifest.xml:5:
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 3 package="com.example.myapplication"> 4 5 <application 6 android:allowBackup="true" 7 android:icon="@mipmap/ic_launcher" 8 android:label="@string/app_name"
GoogleAppIndexingWarning
Usability
Warning
Priority 5/10
Image without contentDescription
../../src/main/res/layout/activity_main.xml:23:
20 21 </com.google.android.material.appbar.AppBarLayout> 22 23 <com.google.android.material.floatingactionbutton.FloatingActionButton 24 android:id="@+id/fab" 25 android:layout_width="wrap_content" 26 android:layout_height="wrap_content"
ContentDescription
Accessibility
Error
Priority 3/10
Disabled Checks
One or more issues were not run by lint, either
because the check is not enabled by default, or because
it was disabled with a command line flag or via one or
more
lint.xml configuration files in the project directories.
Suppressing Warnings and Errors
Lint errors can be suppressed in a variety of ways:
1. With a
2. With a
3. With a //noinspection comment in the source code
4. With ignore flags specified in the
5. With a
6. With a
7. With the --ignore flag passed to lint.
To suppress a lint warning with an annotation, add a
To suppress a lint warning with a comment, add a
To suppress a lint warning in an XML file, add a
To suppress a lint warning in a
Here we specify a comma separated list of issue id's after the disable command. You can also use
To suppress lint warnings with a configuration XML file, create a file named
The format of the
To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
For more information, see https://developer.android.com/studio/write/lint.html#config
1. With a
@SuppressLint annotation in the Java code2. With a
tools:ignore attribute in the XML file3. With a //noinspection comment in the source code
4. With ignore flags specified in the
build.gradle file, as explained below5. With a
lint.xml configuration file in the project6. With a
lint.xml configuration file passed to lint via the --config flag7. With the --ignore flag passed to lint.
To suppress a lint warning with an annotation, add a
@SuppressLint("id") annotation on the class, method or variable declaration closest to the warning instance you want to disable. The id can be one or more issue id's, such as "UnusedResources" or {"UnusedResources","UnusedIds"}, or it can be "all" to suppress all lint warnings in the given scope.To suppress a lint warning with a comment, add a
//noinspection id comment on the line before the statement with the error.To suppress a lint warning in an XML file, add a
tools:ignore="id" attribute on the element containing the error, or one of its surrounding elements. You also need to define the namespace for the tools prefix on the root element in your document, next to the xmlns:android declaration:xmlns:tools="http://schemas.android.com/tools"To suppress a lint warning in a
build.gradle file, add a section like this:
android {
lintOptions {
disable 'TypographyFractions','TypographyQuotes'
}
}
Here we specify a comma separated list of issue id's after the disable command. You can also use
warning or error instead of disable to change the severity of issues.To suppress lint warnings with a configuration XML file, create a file named
lint.xml and place it at the root directory of the module in which it applies.The format of the
lint.xml file is something like the following:
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Ignore everything in the test source set -->
<issue id="all">
<ignore path="\*/test/\*" />
</issue>
<!-- Disable this given check in this project -->
<issue id="IconMissingDensityFolder" severity="ignore" />
<!-- Ignore the ObsoleteLayoutParam issue in the given files -->
<issue id="ObsoleteLayoutParam">
<ignore path="res/layout/activation.xml" />
<ignore path="res/layout-xlarge/activation.xml" />
<ignore regexp="(foo|bar)\.java" />
</issue>
<!-- Ignore the UselessLeaf issue in the given file -->
<issue id="UselessLeaf">
<ignore path="res/layout/main.xml" />
</issue>
<!-- Change the severity of hardcoded strings to "error" -->
<issue id="HardcodedText" severity="error" />
</lint>
To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
$ lint --ignore UnusedResources,UselessLeaf /my/project/pathFor more information, see https://developer.android.com/studio/write/lint.html#config