# Lint Report

Check performed at Thu Mar 24 00:44:25 JST 2016.
9 errors and 0 warnings found:

| Correctness:Messages
8 | MissingTranslation: Incomplete translation
| Security
1 | HardcodedDebugMode: Hardcoded value of `android:debuggable` in the manifest
| Disabled Checks (206)

Correctness:Messages
MissingTranslation: Incomplete translation
../../src/main/res/values/strings.xml:3: "`about`" is not translated in "de" (German), "es" (Spanish), "fr" (French), "it" (Italian), "nl" (Dutch), "sv" (Swedish)

       1 <?xml version="1.0" encoding="utf-8"?>
       2 <resources>
       3 	<string name="about">About</string>
       4     <string name="app_name">Android Daisy 2.02 Reader</string>
       5     <string name="cannot_open_book">Cannot open book :( </string>

../../src/main/res/values/strings.xml:16: "`no_books_found`" is not translated in "nl" (Dutch)

      13     <string name="new_folder_name_not_saved">New folder name NOT saved</string>
      14     <string name="new_folder_name_saved">New folder name saved</string>
      15     <string name="new_value">New value is </string>
      16     <string name="no_books_found">No books found</string>
      17     <string name="no_depth_yet">Depth?</string>
      18     <string name="no_previous_book_saved_msg">Sorry either no details of book were saved, or there is a problem with the stored book. Please use another menu option to find a book to read.</string>

../../src/main/res/values/strings.xml:43: "`playing`" is not translated in "nl" (Dutch)

      40     and sections (where the depth might be level 2).
      41
      42     </string>
      43     <string name="playing">Playing</string>
      44     <string name="player_instructions_description">Instructions for the DAISY player</string>
      45     <string name="playing_message">Playing</string>

../../src/main/res/values/strings.xml:48: "`root_folder`" is not translated in "nl" (Dutch)

      45     <string name="playing_message">Playing</string>
      46     <string name="reading_message">Reading </string>
      47     <string name="return_to_homescreen">Return to home screen</string>
      48     <string name="root_folder">Root Folder</string>
      49     <string name="root_folder_for_daisy_books">Root Folder for DAISY books</string>
      50     <string name="sd_card_folder_changed_successfully">SD Card folder changed successfully</string>

../../src/main/res/values/strings.xml:49: "`root_folder_for_daisy_books`" is not translated in "nl" (Dutch)

      46     <string name="reading_message">Reading </string>
      47     <string name="return_to_homescreen">Return to home screen</string>
      48     <string name="root_folder">Root Folder</string>
      49     <string name="root_folder_for_daisy_books">Root Folder for DAISY books</string>
      50     <string name="sd_card_folder_changed_successfully">SD Card folder changed successfully</string>
      51     <string name="sdcard_mounted">The SD Card appears to be in use (mounted); can you unmount it, then try again?</string>

../../src/main/res/values/strings.xml:65: "`version`" is not translated in "de" (German), "es" (Spanish), "fr" (French), "it" (Italian), "nb" (Norwegian Bokmål), "nl" (Dutch), "nn" (Norwegian Nynorsk), "no" (Norwegian), "sv" (Swedish)

      62     </string>
      63     <string name="unable_to_open_file">Unable to open file</string>
      64     <string name="up_1_level">Up 1 level...</string>
      65     <string name="version">Version: %1$s.%2$s</string>
      66     <string name="finished_reading_book">Finished reading this book</string>
      67     <string name="send_your_email_in">Send your email in:</string>

../../src/main/res/values/strings.xml:66: "`finished_reading_book`" is not translated in "de" (German), "es" (Spanish), "it" (Italian), "nl" (Dutch), "sv" (Swedish)

      63     <string name="unable_to_open_file">Unable to open file</string>
      64     <string name="up_1_level">Up 1 level...</string>
      65     <string name="version">Version: %1$s.%2$s</string>
      66     <string name="finished_reading_book">Finished reading this book</string>
      67     <string name="send_your_email_in">Send your email in:</string>
      68 </resources>

../../src/main/res/values/strings.xml:67: "`send_your_email_in`" is not translated in "da" (Danish), "de" (German), "es" (Spanish), "fr" (French), "it" (Italian), "nb" (Norwegian Bokmål), "nl" (Dutch), "nn" (Norwegian Nynorsk), "no" (Norwegian), "sv" (Swedish)

      64     <string name="up_1_level">Up 1 level...</string>
      65     <string name="version">Version: %1$s.%2$s</string>
      66     <string name="finished_reading_book">Finished reading this book</string>
      67     <string name="send_your_email_in">Send your email in:</string>
      68 </resources>
      69

Note: This issue has an associated quickfix operation in Eclipse/ADT
Priority: 8 / 10
Category: Correctness:Messages
Severity: Fatal
Explanation: Incomplete translation.
If an application has more than one locale, then all the strings declared in one language should also be translated in all other languages.
If the string should not be translated, you can add the attribute `translatable="false"` on the `<string>` element, or you can define all your non-translatable strings in a resource file called `donottranslate.xml`. Or, you can ignore the issue with a `tools:ignore="MissingTranslation"` attribute.
By default this detector allows regions of a language to just provide a subset of the strings and fall back to the standard language strings. You can require all regions to provide a full translation by setting the environment variable `ANDROID_LINT_COMPLETE_REGIONS`.
You can tell lint (and other tools) which language is the default language in your `res/values/` folder by specifying `tools:locale="languageCode"` for the root `<resources>` element in your resource file. (The `tools` prefix refers to the namespace declaration `http://schemas.android.com/tools`.)
More info:
To suppress this error, use the issue id "MissingTranslation" as explained in the Suppressing Warnings and Errors section.
Security
HardcodedDebugMode: Hardcoded value of `android:debuggable` in the manifest
../../src/main/AndroidManifest.xml:5: Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one

       2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
       3 	package="com.ader" android:versionCode="1" android:versionName="1.0.527">
       4 	<application android:icon="@drawable/icon" android:label="@string/app_name"
       5 	android:debuggable="true" android:theme="@android:style/Theme.NoTitleBar">
       6 		<activity
       7 			android:name="com.ader.ui.HomeScreen"

Priority: 5 / 10
Category: Security
Severity: Fatal
Explanation: Hardcoded value of `android:debuggable` in the manifest.
It's best to leave out the `android:debuggable` attribute from the manifest. If you do, then the tools will automatically insert `android:debuggable=true` when building an APK to debug on an emulator or device. And when you perform a release build, such as Exporting APK, it will automatically set it to `false`.
If on the other hand you specify a specific value in the manifest file, then the tools will always use it. This can lead to accidentally publishing your app with debug information.
More info:
To suppress this error, use the issue id "HardcodedDebugMode" as explained in the Suppressing Warnings and Errors section.
Disabled Checks
The following 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.
AccidentalOctal
Disabled By: Project lint.xml file
Priority: 2 / 10
Category: Correctness
Severity: Error
Explanation: Accidental Octal.
In Groovy, an integer literal that starts with a leading 0 will be interpreted as an octal number. That is usually (always?) an accident and can lead to subtle bugs, for example when used in the `versionCode` of an app.
More info:
To suppress this error, use the issue id "AccidentalOctal" as explained in the Suppressing Warnings and Errors section.
AdapterViewChildren
Disabled By: Project lint.xml file
Priority: 10 / 10
Category: Correctness
Severity: Warning
Explanation: AdapterViews cannot have children in XML.
AdapterViews such as ListViews must be configured with data from Java code, such as a ListAdapter.
More info: http://developer.android.com/reference/android/widget/AdapterView.html
To suppress this error, use the issue id "AdapterViewChildren" as explained in the Suppressing Warnings and Errors section.
AddJavascriptInterface
Disabled By: Project lint.xml file
Priority: 9 / 10
Category: Security
Severity: Warning
Explanation: addJavascriptInterface Called.
For applications built for API levels below 17, `WebView#addJavascriptInterface` presents a security hazard as JavaScript on the target web page has the ability to use reflection to access the injected object's public fields and thus manipulate the host application in unintended ways.
More info: https://labs.mwrinfosecurity.com/blog/2013/09/24/webview-addjavascriptinterface-remote-code-execution/
To suppress this error, use the issue id "AddJavascriptInterface" as explained in the Suppressing Warnings and Errors section.
AllowAllHostnameVerifier
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Security
Severity: Warning
Explanation: Insecure HostnameVerifier.
This check looks for declaration or use of HostnameVerifier implementations whose `verify` method always returns true (thus trusting any hostname) which could result in insecure network traffic caused by trusting arbitrary hostnames in TLS/SSL certificates presented by peers.
More info:
To suppress this error, use the issue id "AllowAllHostnameVerifier" as explained in the Suppressing Warnings and Errors section.
AllowBackup
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Security
Severity: Warning
Explanation: AllowBackup/FullBackupContent Problems.
The `allowBackup` attribute determines if an application's data can be backed up and restored. It is documented at http://developer.android.com/reference/android/R.attr.html#allowBackup
By default, this flag is set to `true`. When this flag is set to `true`, application data can be backed up and restored by the user using `adb backup` and `adb restore`.
This may have security consequences for an application. `adb backup` allows users who have enabled USB debugging to copy application data off of the device. Once backed up, all application data can be read by the user. `adb restore` allows creation of application data from a source specified by the user. Following a restore, applications should not assume that the data, file permissions, and directory permissions were created by the application itself.
Setting `allowBackup="false"` opts an application out of both backup and restore.
To fix this warning, decide whether your application should support backup, and explicitly set `android:allowBackup=(true|false)"`.
If not set to false, and if targeting API 23 or later, lint will also warn that you should set `android:fullBackupContent` to configure auto backup.
More info:

- https://developer.android.com/preview/backup/index.html
- http://developer.android.com/reference/android/R.attr.html#allowBackup

To suppress this error, use the issue id "AllowBackup" as explained in the Suppressing Warnings and Errors section.
AlwaysShowAction
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Usability
Severity: Warning
Explanation: Usage of `showAsAction=always`
Using `showAsAction="always"` in menu XML, or `MenuItem.SHOW_AS_ACTION_ALWAYS` in Java code is usually a deviation from the user interface style guide.Use `ifRoom` or the corresponding `MenuItem.SHOW_AS_ACTION_IF_ROOM` instead.
If `always` is used sparingly there are usually no problems and behavior is roughly equivalent to `ifRoom` but with preference over other `ifRoom` items. Using it more than twice in the same menu is a bad idea.
This check looks for menu XML files that contain more than two `always` actions, or some `always` actions and no `ifRoom` actions. In Java code, it looks for projects that contain references to `MenuItem.SHOW_AS_ACTION_ALWAYS` and no references to `MenuItem.SHOW_AS_ACTION_IF_ROOM`.
More info: http://developer.android.com/design/patterns/actionbar.html
To suppress this error, use the issue id "AlwaysShowAction" as explained in the Suppressing Warnings and Errors section.
AndroidGradlePluginVersion
Disabled By: Project lint.xml file
Priority: 8 / 10
Category: Correctness
Severity: Error
Explanation: Incompatible Android Gradle Plugin.
Not all versions of the Android Gradle plugin are compatible with all versions of the SDK. If you update your tools, or if you are trying to open a project that was built with an old version of the tools, you may need to update your plugin version number.
More info:
To suppress this error, use the issue id "AndroidGradlePluginVersion" as explained in the Suppressing Warnings and Errors section.
AppCompatMethod
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Using Wrong AppCompat Method.
When using the appcompat library, there are some methods you should be calling instead of the normal ones; for example, `getSupportActionBar()` instead of `getActionBar()`. This lint check looks for calls to the wrong method.
More info: http://developer.android.com/tools/support-library/index.html
To suppress this error, use the issue id "AppCompatMethod" as explained in the Suppressing Warnings and Errors section.
AppCompatResource
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability
Severity: Error
Explanation: Menu namespace.
When using the appcompat library, menu resources should refer to the `showAsAction` in the `app:` namespace, not the `android:` namespace.
Similarly, when not using the appcompat library, you should be using the `android:showAsAction` attribute.
More info:
To suppress this error, use the issue id "AppCompatResource" as explained in the Suppressing Warnings and Errors section.
Assert
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Assertions.
Assertions are not checked at runtime. There are ways to request that they be used by Dalvik (`adb shell setprop debug.assert 1`), but the property is ignored in many places and can not be relied upon. Instead, perform conditional checking inside `if (BuildConfig.DEBUG) { }` blocks. That constant is a static final boolean which is true in debug builds and false in release builds, and the Java compiler completely removes all code inside the if-body from the app.
For example, you can replace `assert speed > 0` with `if (BuildConfig.DEBUG && !(speed > 0)) { throw new AssertionError() }`.
(Note: This lint check does not flag assertions purely asserting nullness or non-nullness; these are typically more intended for tools usage than runtime checks.)
More info: https://code.google.com/p/android/issues/detail?id=65183
To suppress this error, use the issue id "Assert" as explained in the Suppressing Warnings and Errors section.
BackButton
Disabled By: Default
Priority: 6 / 10
Category: Usability
Severity: Warning
Explanation: Back button.
According to the Android Design Guide,
"Other platforms use an explicit back button with label to allow the user to navigate up the application's hierarchy. Instead, Android uses the main action bar's app icon for hierarchical navigation and the navigation bar's back button for temporal navigation."
This check is not very sophisticated (it just looks for buttons with the label "Back"), so it is disabled by default to not trigger on common scenarios like pairs of Back/Next buttons to paginate through screens.
More info: http://developer.android.com/design/patterns/pure-android.html
To suppress this error, use the issue id "BackButton" as explained in the Suppressing Warnings and Errors section.
ButtonCase
Disabled By: Project lint.xml file
Priority: 2 / 10
Category: Usability
Severity: Warning
Explanation: Cancel/OK dialog button capitalization.
The standard capitalization for OK/Cancel dialogs is "OK" and "Cancel". To ensure that your dialogs use the standard strings, you can use the resource strings @android:string/ok and @android:string/cancel.
More info:
To suppress this error, use the issue id "ButtonCase" as explained in the Suppressing Warnings and Errors section.
ButtonOrder
Disabled By: Project lint.xml file
Priority: 8 / 10
Category: Usability
Severity: Warning
Explanation: Button order.
According to the Android Design Guide,
"Action buttons are typically Cancel and/or OK, with OK indicating the preferred or most likely action. However, if the options consist of specific actions such as Close or Wait rather than a confirmation or cancellation of the action described in the content, then all the buttons should be active verbs. As a rule, the dismissive action of a dialog is always on the left whereas the affirmative actions are on the right."
This check looks for button bars and buttons which look like cancel buttons, and makes sure that these are on the left.
More info: http://developer.android.com/design/building-blocks/dialogs.html
To suppress this error, use the issue id "ButtonOrder" as explained in the Suppressing Warnings and Errors section.
ButtonStyle
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability
Severity: Warning
Explanation: Button should be borderless.
Button bars typically use a borderless style for the buttons. Set the `style="?android:attr/buttonBarButtonStyle"` attribute on each of the buttons, and set `style="?android:attr/buttonBarStyle"` on the parent layout
More info: http://developer.android.com/design/building-blocks/buttons.html
To suppress this error, use the issue id "ButtonStyle" as explained in the Suppressing Warnings and Errors section.
CheckResult
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Ignoring results.
Some methods have no side effects, an calling them without doing something without the result is suspicious.
More info:
To suppress this error, use the issue id "CheckResult" as explained in the Suppressing Warnings and Errors section.
ClickableViewAccessibility
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Accessibility
Severity: Warning
Explanation: Accessibility in Custom Views.
If a `View` that overrides `onTouchEvent` or uses an `OnTouchListener` does not also implement `performClick` and call it when clicks are detected, the `View` may not handle accessibility actions properly. Logic handling the click actions should ideally be placed in `View#performClick` as some accessibility services invoke `performClick` when a click action should occur.
More info:
To suppress this error, use the issue id "ClickableViewAccessibility" as explained in the Suppressing Warnings and Errors section.
CommitPrefEdits
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Missing `commit()` on `SharedPreference` editor.
After calling `edit()` on a `SharedPreference`, you must call `commit()` or `apply()` on the editor to save the results.
More info:
To suppress this error, use the issue id "CommitPrefEdits" as explained in the Suppressing Warnings and Errors section.
CommitTransaction
Disabled By: Project lint.xml file
Priority: 7 / 10
Category: Correctness
Severity: Warning
Explanation: Missing `commit()` calls.
After creating a `FragmentTransaction`, you typically need to commit it as well
More info:
To suppress this error, use the issue id "CommitTransaction" as explained in the Suppressing Warnings and Errors section.
ContentDescription
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Accessibility
Severity: Warning
Explanation: Image without `contentDescription`
Non-textual widgets like ImageViews and ImageButtons should use the `contentDescription` attribute to specify a textual description of the widget such that screen readers and other accessibility tools can adequately describe the user interface.
Note that elements in application screens that are purely decorative and do not provide any content or enable a user action should not have accessibility content descriptions. In this case, just suppress the lint warning with a tools:ignore="ContentDescription" attribute.
Note that for text fields, you should not set both the `hint` and the `contentDescription` attributes since the hint will never be shown. Just set the `hint`. See http://developer.android.com/guide/topics/ui/accessibility/checklist.html#special-cases.
More info:
To suppress this error, use the issue id "ContentDescription" as explained in the Suppressing Warnings and Errors section.
CustomViewStyleable
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Mismatched Styleable/Custom View Name.
The convention for custom views is to use a `declare-styleable` whose name matches the custom view class name. The IDE relies on this convention such that for example code completion can be offered for attributes in a custom view in layout XML resource files.
(Similarly, layout parameter classes should use the suffix `_Layout`.)
More info:
To suppress this error, use the issue id "CustomViewStyleable" as explained in the Suppressing Warnings and Errors section.
CutPasteId
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Likely cut & paste mistakes.
This lint check looks for cases where you have cut & pasted calls to `findViewById` but have forgotten to update the R.id field. It's possible that your code is simply (redundantly) looking up the field repeatedly, but lint cannot distinguish that from a case where you for example want to initialize fields `prev` and `next` and you cut & pasted `findViewById(R.id.prev)` and forgot to update the second initialization to `R.id.next`.
More info:
To suppress this error, use the issue id "CutPasteId" as explained in the Suppressing Warnings and Errors section.
DalvikOverride
Disabled By: Project lint.xml file
Priority: 7 / 10
Category: Correctness
Severity: Error
Explanation: Method considered overridden by Dalvik.
The Android virtual machine will treat a package private method in one class as overriding a package private method in its super class, even if they are in separate packages. This may be surprising, but for compatibility reasons the behavior has not been changed (yet).
If you really did intend for this method to override the other, make the method `protected` instead.
If you did not intend the override, consider making the method private, or changing its name or signature.
More info:
To suppress this error, use the issue id "DalvikOverride" as explained in the Suppressing Warnings and Errors section.
DefaultLocale
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Implied default locale in case conversion.
Calling `String#toLowerCase()` or `#toUpperCase()` without specifying an explicit locale is a common source of bugs. The reason for that is that those methods will use the current locale on the user's device, and even though the code appears to work correctly when you are developing the app, it will fail in some locales. For example, in the Turkish locale, the uppercase replacement for `i` is not `I`.
If you want the methods to just perform ASCII replacement, for example to convert an enum name, call `String#toUpperCase(Locale.US)` instead. If you really want to use the current locale, call `String#toUpperCase(Locale.getDefault())` instead.
More info: http://developer.android.com/reference/java/util/Locale.html#default_locale
To suppress this error, use the issue id "DefaultLocale" as explained in the Suppressing Warnings and Errors section.
Deprecated
Disabled By: Project lint.xml file
Priority: 2 / 10
Category: Correctness
Severity: Warning
Explanation: Using deprecated resources.
Deprecated views, attributes and so on are deprecated because there is a better way to do something. Do it that new way. You've been warned.
More info:
To suppress this error, use the issue id "Deprecated" as explained in the Suppressing Warnings and Errors section.
DeviceAdmin
Disabled By: Project lint.xml file
Priority: 7 / 10
Category: Correctness
Severity: Warning
Explanation: Malformed Device Admin.
If you register a broadcast receiver which acts as a device admin, you must also register an `<intent-filter>` for the action `android.app.action.DEVICE_ADMIN_ENABLED`, without any `<data>`, such that the device admin can be activated/deactivated.
To do this, add
`<intent-filter>`
`<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />`
`</intent-filter>`
to your `<receiver>`.
More info:
To suppress this error, use the issue id "DeviceAdmin" as explained in the Suppressing Warnings and Errors section.
DisableBaselineAlignment
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Performance
Severity: Warning
Explanation: Missing `baselineAligned` attribute.
When a LinearLayout is used to distribute the space proportionally between nested layouts, the baseline alignment property should be turned off to make the layout computation faster.
More info:
To suppress this error, use the issue id "DisableBaselineAlignment" as explained in the Suppressing Warnings and Errors section.
DrawAllocation
Disabled By: Project lint.xml file
Priority: 9 / 10
Category: Performance
Severity: Warning
Explanation: Memory allocations within drawing code.
You should avoid allocating objects during a drawing or layout operation. These are called frequently, so a smooth UI can be interrupted by garbage collection pauses caused by the object allocations.
The way this is generally handled is to allocate the needed objects up front and to reuse them for each drawing operation.
Some methods allocate memory on your behalf (such as `Bitmap.create`), and these should be handled in the same way.
More info:
To suppress this error, use the issue id "DrawAllocation" as explained in the Suppressing Warnings and Errors section.
DuplicateDefinition
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Duplicate definitions of resources.
You can define a resource multiple times in different resource folders; that's how string translations are done, for example. However, defining the same resource more than once in the same resource folder is likely an error, for example attempting to add a new resource without realizing that the name is already used, and so on.
More info:
To suppress this error, use the issue id "DuplicateDefinition" as explained in the Suppressing Warnings and Errors section.
DuplicateIncludedIds
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Duplicate ids across layouts combined with include tags.
It's okay for two independent layouts to use the same ids. However, if layouts are combined with include tags, then the id's need to be unique within any chain of included layouts, or `Activity#findViewById()` can return an unexpected view.
More info:
To suppress this error, use the issue id "DuplicateIncludedIds" as explained in the Suppressing Warnings and Errors section.
DuplicateUsesFeature
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness
Severity: Warning
Explanation: Feature declared more than once.
A given feature should only be declared once in the manifest.
More info:
To suppress this error, use the issue id "DuplicateUsesFeature" as explained in the Suppressing Warnings and Errors section.
EasterEgg
Disabled By: Default
Priority: 6 / 10
Category: Security
Severity: Warning
Explanation: Code contains easter egg.
An "easter egg" is code deliberately hidden in the code, both from potential users and even from other developers. This lint check looks for code which looks like it may be hidden from sight.
More info:
To suppress this error, use the issue id "EasterEgg" as explained in the Suppressing Warnings and Errors section.
ExportedContentProvider
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Security
Severity: Warning
Explanation: Content provider does not require permission.
Content providers are exported by default and any application on the system can potentially use them to read and write data. If the content provider provides access to sensitive data, it should be protected by specifying `export=false` in the manifest or by protecting it with a permission that can be granted to other applications.
More info:
To suppress this error, use the issue id "ExportedContentProvider" as explained in the Suppressing Warnings and Errors section.
ExportedPreferenceActivity
Disabled By: Project lint.xml file
Priority: 8 / 10
Category: Security
Severity: Warning
Explanation: PreferenceActivity should not be exported.
Fragment injection gives anyone who can send your PreferenceActivity an intent the ability to load any fragment, with any arguments, in your process.
More info: http://securityintelligence.com/new-vulnerability-android-framework-fragment-injection
To suppress this error, use the issue id "ExportedPreferenceActivity" as explained in the Suppressing Warnings and Errors section.
ExportedReceiver
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Security
Severity: Warning
Explanation: Receiver does not require permission.
Exported receivers (receivers which either set `exported=true` or contain an intent-filter and do not specify `exported=false`) should define a permission that an entity must have in order to launch the receiver or bind to it. Without this, any application can use this receiver.
More info:
To suppress this error, use the issue id "ExportedReceiver" as explained in the Suppressing Warnings and Errors section.
ExportedService
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Security
Severity: Warning
Explanation: Exported service does not require permission.
Exported services (services which either set `exported=true` or contain an intent-filter and do not specify `exported=false`) should define a permission that an entity must have in order to launch the service or bind to it. Without this, any application can use this service.
More info:
To suppress this error, use the issue id "ExportedService" as explained in the Suppressing Warnings and Errors section.
ExtraText
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Correctness
Severity: Warning
Explanation: Extraneous text in resource files.
Layout resource files should only contain elements and attributes. Any XML text content found in the file is likely accidental (and potentially dangerous if the text resembles XML and the developer believes the text to be functional)
More info:
To suppress this error, use the issue id "ExtraText" as explained in the Suppressing Warnings and Errors section.
FieldGetter
Disabled By: Default
Priority: 4 / 10
Category: Performance
Severity: Warning
Explanation: Using getter instead of field.
Accessing a field within the class that defines a getter for that field is at least 3 times faster than calling the getter. For simple getters that do nothing other than return the field, you might want to just reference the local field directly instead.
NOTE: As of Android 2.3 (Gingerbread), this optimization is performed automatically by Dalvik, so there is no need to change your code; this is only relevant if you are targeting older versions of Android.
More info: http://developer.android.com/guide/practices/design/performance.html#internal_get_set
To suppress this error, use the issue id "FieldGetter" as explained in the Suppressing Warnings and Errors section.
FloatMath
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Performance
Severity: Warning
Explanation: Using `FloatMath` instead of `Math`
In older versions of Android, using `android.util.FloatMath` was recommended for performance reasons when operating on floats. However, on modern hardware doubles are just as fast as float (though they take more memory), and in recent versions of Android, `FloatMath` is actually slower than using `java.lang.Math` due to the way the JIT optimizes `java.lang.Math`. Therefore, you should use `Math` instead of `FloatMath` if you are only targeting Froyo and above.
More info: http://developer.android.com/guide/practices/design/performance.html#avoidfloat
To suppress this error, use the issue id "FloatMath" as explained in the Suppressing Warnings and Errors section.
GetInstance
Disabled By: Project lint.xml file
Priority: 9 / 10
Category: Security
Severity: Warning
Explanation: Cipher.getInstance with ECB.
`Cipher#getInstance` should not be called with ECB as the cipher mode or without setting the cipher mode because the default mode on android is ECB, which is insecure.
More info:
To suppress this error, use the issue id "GetInstance" as explained in the Suppressing Warnings and Errors section.
GifUsage
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Using `.gif` format for bitmaps is discouraged.
The `.gif` file format is discouraged. Consider using `.png` (preferred) or `.jpg` (acceptable) instead.
More info: http://developer.android.com/guide/topics/resources/drawable-resource.html#Bitmap
To suppress this error, use the issue id "GifUsage" as explained in the Suppressing Warnings and Errors section.
GoogleAppIndexingApiWarning
Disabled By: Default
Priority: 5 / 10
Category: Usability
Severity: Warning
Explanation: Missing support for Google App Indexing Api.
Adds deep links to get your app into the Google index, to get installs and traffic to your app from Google Search.
More info: https://g.co/AppIndexing/AndroidStudio
To suppress this error, use the issue id "GoogleAppIndexingApiWarning" as explained in the Suppressing Warnings and Errors section.
GoogleAppIndexingDeepLinkError
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability
Severity: Error
Explanation: Deep link not supported by app for Google App Indexing.
Ensure the deep link is supported by your app, to get installs and traffic to yourapp from Google Search.
More info: https://g.co/AppIndexing/AndroidStudio
To suppress this error, use the issue id "GoogleAppIndexingDeepLinkError" as explained in the Suppressing Warnings and Errors section.
GoogleAppIndexingWarning
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability
Severity: Warning
Explanation: Missing support for Google App Indexing.
Adds deep links to get your app into the Google index, to get installs and traffic to your app from Google Search.
More info: https://g.co/AppIndexing/AndroidStudio
To suppress this error, use the issue id "GoogleAppIndexingWarning" as explained in the Suppressing Warnings and Errors section.
GradleCompatible
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 8 / 10
Category: Correctness
Severity: Error
Explanation: Incompatible Gradle Versions.
There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your `targetSdkVersion`.)
More info:
To suppress this error, use the issue id "GradleCompatible" as explained in the Suppressing Warnings and Errors section.
GradleDependency
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Correctness
Severity: Warning
Explanation: Obsolete Gradle Dependency.
This detector looks for usages of libraries where the version you are using is not the current stable release. Using older versions is fine, and there are cases where you deliberately want to stick with an older version. However, you may simply not be aware that a more recent version is available, and that is what this lint check helps find.
More info:
To suppress this error, use the issue id "GradleDependency" as explained in the Suppressing Warnings and Errors section.
GradleDeprecated
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Deprecated Gradle Construct.
This detector looks for deprecated Gradle constructs which currently work but will likely stop working in a future update.
More info:
To suppress this error, use the issue id "GradleDeprecated" as explained in the Suppressing Warnings and Errors section.
GradleDynamicVersion
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Correctness
Severity: Warning
Explanation: Gradle Dynamic Version.
Using `+` in dependencies lets you automatically pick up the latest available version rather than a specific, named version. However, this is not recommended; your builds are not repeatable; you may have tested with a slightly different version than what the build server used. (Using a dynamic version as the major version number is more problematic than using it in the minor version position.)
More info:
To suppress this error, use the issue id "GradleDynamicVersion" as explained in the Suppressing Warnings and Errors section.
GradleGetter
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Gradle Implicit Getter Call.
Gradle will let you replace specific constants in your build scripts with method calls, so you can for example dynamically compute a version string based on your current version control revision number, rather than hardcoding a number.
When computing a version name, it's tempting to for example call the method to do that `getVersionName`. However, when you put that method call inside the `defaultConfig` block, you will actually be calling the Groovy getter for the `versionName` property instead. Therefore, you need to name your method something which does not conflict with the existing implicit getters. Consider using `compute` as a prefix instead of `get`.
More info:
To suppress this error, use the issue id "GradleGetter" as explained in the Suppressing Warnings and Errors section.
GradleIdeError
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Correctness
Severity: Error
Explanation: Gradle IDE Support Issues.
Gradle is highly flexible, and there are things you can do in Gradle files which can make it hard or impossible for IDEs to properly handle the project. This lint check looks for constructs that potentially break IDE support.
More info:
To suppress this error, use the issue id "GradleIdeError" as explained in the Suppressing Warnings and Errors section.
GradleOverrides
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Correctness
Severity: Warning
Explanation: Value overridden by Gradle build script.
The value of (for example) `minSdkVersion` is only used if it is not specified in the `build.gradle` build scripts. When specified in the Gradle build scripts, the manifest value is ignored and can be misleading, so should be removed to avoid ambiguity.
More info:
To suppress this error, use the issue id "GradleOverrides" as explained in the Suppressing Warnings and Errors section.
GradlePath
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Correctness
Severity: Warning
Explanation: Gradle Path Issues.
Gradle build scripts are meant to be cross platform, so file paths use Unix-style path separators (a forward slash) rather than Windows path separators (a backslash). Similarly, to keep projects portable and repeatable, avoid using absolute paths on the system; keep files within the project instead. To share code between projects, consider creating an android-library and an AAR dependency
More info:
To suppress this error, use the issue id "GradlePath" as explained in the Suppressing Warnings and Errors section.
GrantAllUris
Disabled By: Project lint.xml file
Priority: 7 / 10
Category: Security
Severity: Warning
Explanation: Content provider shares everything.
The `<grant-uri-permission>` element allows specific paths to be shared. This detector checks for a path URL of just '/' (everything), which is probably not what you want; you should limit access to a subset.
More info:
To suppress this error, use the issue id "GrantAllUris" as explained in the Suppressing Warnings and Errors section.
HandlerLeak
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Performance
Severity: Warning
Explanation: Handler reference leaks.
Since this Handler is declared as an inner class, it may prevent the outer class from being garbage collected. If the Handler is using a Looper or MessageQueue for a thread other than the main thread, then there is no issue. If the Handler is using the Looper or MessageQueue of the main thread, you need to fix your Handler declaration, as follows: Declare the Handler as a static class; In the outer class, instantiate a WeakReference to the outer class and pass this object to your Handler when you instantiate the Handler; Make all references to members of the outer class using the WeakReference object.
More info:
To suppress this error, use the issue id "HandlerLeak" as explained in the Suppressing Warnings and Errors section.
HardcodedText
Note: This issue has an associated quickfix operation in Eclipse/ADT
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Internationalization
Severity: Warning
Explanation: Hardcoded text.
Hardcoding text attributes directly in layout files is bad for several reasons:
* When creating configuration variations (for example for landscape or portrait)you have to repeat the actual text (and keep it up to date when making changes)
* The application cannot be translated to other languages by just adding new translations for existing string resources.
In Android Studio and Eclipse there are quickfixes to automatically extract this hardcoded string into a resource lookup.
More info:
To suppress this error, use the issue id "HardcodedText" as explained in the Suppressing Warnings and Errors section.
IconColors
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Icon colors do not follow the recommended visual style.
Notification icons and Action Bar icons should only white and shades of gray. See the Android Design Guide for more details. Note that the way Lint decides whether an icon is an action bar icon or a notification icon is based on the filename prefix: `ic_menu_` for action bar icons, `ic_stat_` for notification icons etc. These correspond to the naming conventions documented in http://developer.android.com/guide/practices/ui_guidelines/icon_design.html
More info: http://developer.android.com/design/style/iconography.html
To suppress this error, use the issue id "IconColors" as explained in the Suppressing Warnings and Errors section.
IconDensities
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Icon densities validation.
Icons will look best if a custom version is provided for each of the major screen density classes (low, medium, high, extra high). This lint check identifies icons which do not have complete coverage across the densities.
Low density is not really used much anymore, so this check ignores the ldpi density. To force lint to include it, set the environment variable `ANDROID_LINT_INCLUDE_LDPI=true`. For more information on current density usage, see http://developer.android.com/resources/dashboard/screens.html
More info: http://developer.android.com/guide/practices/screens_support.html
To suppress this error, use the issue id "IconDensities" as explained in the Suppressing Warnings and Errors section.
IconDipSize
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Icon density-independent size validation.
Checks the all icons which are provided in multiple densities, all compute to roughly the same density-independent pixel (`dip`) size. This catches errors where images are either placed in the wrong folder, or icons are changed to new sizes but some folders are forgotten.
More info:
To suppress this error, use the issue id "IconDipSize" as explained in the Suppressing Warnings and Errors section.
IconDuplicates
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Duplicated icons under different names.
If an icon is repeated under different names, you can consolidate and just use one of the icons and delete the others to make your application smaller. However, duplicated icons usually are not intentional and can sometimes point to icons that were accidentally overwritten or accidentally not updated.
More info:
To suppress this error, use the issue id "IconDuplicates" as explained in the Suppressing Warnings and Errors section.
IconDuplicatesConfig
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Identical bitmaps across various configurations.
If an icon is provided under different configuration parameters such as `drawable-hdpi` or `-v11`, they should typically be different. This detector catches cases where the same icon is provided in different configuration folder which is usually not intentional.
More info:
To suppress this error, use the issue id "IconDuplicatesConfig" as explained in the Suppressing Warnings and Errors section.
IconExpectedSize
Disabled By: Default
Priority: 5 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Icon has incorrect size.
There are predefined sizes (for each density) for launcher icons. You should follow these conventions to make sure your icons fit in with the overall look of the platform.
More info: http://developer.android.com/design/style/iconography.html
To suppress this error, use the issue id "IconExpectedSize" as explained in the Suppressing Warnings and Errors section.
IconExtension
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Icon format does not match the file extension.
Ensures that icons have the correct file extension (e.g. a `.png` file is really in the PNG format and not for example a GIF file named `.png`.)
More info:
To suppress this error, use the issue id "IconExtension" as explained in the Suppressing Warnings and Errors section.
IconLauncherShape
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Usability:Icons
Severity: Warning
Explanation: The launcher icon shape should use a distinct silhouette.
According to the Android Design Guide (http://developer.android.com/design/style/iconography.html) your launcher icons should "use a distinct silhouette", a "three-dimensional, front view, with a slight perspective as if viewed from above, so that users perceive some depth."
The unique silhouette implies that your launcher icon should not be a filled square.
More info: http://developer.android.com/design/style/iconography.html
To suppress this error, use the issue id "IconLauncherShape" as explained in the Suppressing Warnings and Errors section.
IconLocation
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Image defined in density-independent drawable folder.
The res/drawable folder is intended for density-independent graphics such as shapes defined in XML. For bitmaps, move it to `drawable-mdpi` and consider providing higher and lower resolution versions in `drawable-ldpi`, `drawable-hdpi` and `drawable-xhdpi`. If the icon really is density independent (for example a solid color) you can place it in `drawable-nodpi`.
More info: http://developer.android.com/guide/practices/screens_support.html
To suppress this error, use the issue id "IconLocation" as explained in the Suppressing Warnings and Errors section.
IconMissingDensityFolder
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Missing density folder.
Icons will look best if a custom version is provided for each of the major screen density classes (low, medium, high, extra-high, extra-extra-high). This lint check identifies folders which are missing, such as `drawable-hdpi`.
Low density is not really used much anymore, so this check ignores the ldpi density. To force lint to include it, set the environment variable `ANDROID_LINT_INCLUDE_LDPI=true`. For more information on current density usage, see http://developer.android.com/resources/dashboard/screens.html
More info: http://developer.android.com/guide/practices/screens_support.html
To suppress this error, use the issue id "IconMissingDensityFolder" as explained in the Suppressing Warnings and Errors section.
IconMixedNinePatch
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Clashing PNG and 9-PNG files.
If you accidentally name two separate resources `file.png` and `file.9.png`, the image file and the nine patch file will both map to the same drawable resource, `@drawable/file`, which is probably not what was intended.
More info:
To suppress this error, use the issue id "IconMixedNinePatch" as explained in the Suppressing Warnings and Errors section.
IconNoDpi
Disabled By: Project lint.xml file
Priority: 7 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Icon appears in both `-nodpi` and dpi folders.
Bitmaps that appear in `drawable-nodpi` folders will not be scaled by the Android framework. If a drawable resource of the same name appears both in a `-nodpi` folder as well as a dpi folder such as `drawable-hdpi`, then the behavior is ambiguous and probably not intentional. Delete one or the other, or use different names for the icons.
More info:
To suppress this error, use the issue id "IconNoDpi" as explained in the Suppressing Warnings and Errors section.
IconXmlAndPng
Disabled By: Project lint.xml file
Priority: 7 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Icon is specified both as `.xml` file and as a bitmap.
If a drawable resource appears as an `.xml` file in the `drawable/` folder, it's usually not intentional for it to also appear as a bitmap using the same name; generally you expect the drawable XML file to define states and each state has a corresponding drawable bitmap.
More info:
To suppress this error, use the issue id "IconXmlAndPng" as explained in the Suppressing Warnings and Errors section.
IllegalResourceRef
Disabled By: Project lint.xml file
Priority: 8 / 10
Category: Correctness
Severity: Warning
Explanation: Name and version must be integer or string, not resource.
For the `versionCode` attribute, you have to specify an actual integer literal; you cannot use an indirection with a `@dimen/name` resource. Similarly, the `versionName` attribute should be an actual string, not a string resource url.
More info:
To suppress this error, use the issue id "IllegalResourceRef" as explained in the Suppressing Warnings and Errors section.
ImpliedQuantity
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness:Messages
Severity: Error
Explanation: Implied Quantities.
Plural strings should generally include a `%s` or `%d` formatting argument. In locales like English, the `one` quantity only applies to a single value, 1, but that's not true everywhere. For example, in Slovene, the `one` quantity will apply to 1, 101, 201, 301, and so on. Similarly, there are locales where multiple values match the `zero` and `two` quantities.
In these locales, it is usually an error to have a message which does not include a formatting argument (such as '%d'), since it will not be clear from the grammar what quantity the quantity string is describing.
More info: http://developer.android.com/guide/topics/resources/string-resource.html#Plurals
To suppress this error, use the issue id "ImpliedQuantity" as explained in the Suppressing Warnings and Errors section.
InOrMmUsage
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Correctness
Severity: Warning
Explanation: Using `mm` or `in` dimensions.
Avoid using `mm` (millimeters) or `in` (inches) as the unit for dimensions.
While it should work in principle, unfortunately many devices do not report the correct true physical density, which means that the dimension calculations won't work correctly. You are better off using `dp` (and for font sizes, `sp`.)
More info:
To suppress this error, use the issue id "InOrMmUsage" as explained in the Suppressing Warnings and Errors section.
IncludeLayoutParam
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness
Severity: Error
Explanation: Ignored layout params on include.
Layout parameters specified on an `<include>` tag will only be used if you also override `layout_width` and `layout_height` on the `<include>` tag; otherwise they will be ignored.
More info: http://stackoverflow.com/questions/2631614/does-android-xml-layouts-include-tag-really-work
To suppress this error, use the issue id "IncludeLayoutParam" as explained in the Suppressing Warnings and Errors section.
InconsistentArrays
Disabled By: Project lint.xml file
Priority: 7 / 10
Category: Correctness
Severity: Warning
Explanation: Inconsistencies in array element counts.
When an array is translated in a different locale, it should normally have the same number of elements as the original array. When adding or removing elements to an array, it is easy to forget to update all the locales, and this lint warning finds inconsistencies like these.
Note however that there may be cases where you really want to declare a different number of array items in each configuration (for example where the array represents available options, and those options differ for different layout orientations and so on), so use your own judgement to decide if this is really an error.
You can suppress this error type if it finds false errors in your project.
More info:
To suppress this error, use the issue id "InconsistentArrays" as explained in the Suppressing Warnings and Errors section.
InconsistentLayout
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Inconsistent Layouts.
This check ensures that a layout resource which is defined in multiple resource folders, specifies the same set of widgets.
This finds cases where you have accidentally forgotten to add a widget to all variations of the layout, which could result in a runtime crash for some resource configurations when a `findViewById()` fails.
There are cases where this is intentional. For example, you may have a dedicated large tablet layout which adds some extra widgets that are not present in the phone version of the layout. As long as the code accessing the layout resource is careful to handle this properly, it is valid. In that case, you can suppress this lint check for the given extra or missing views, or the whole layout
More info:
To suppress this error, use the issue id "InconsistentLayout" as explained in the Suppressing Warnings and Errors section.
InefficientWeight
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Performance
Severity: Warning
Explanation: Inefficient layout weight.
When only a single widget in a LinearLayout defines a weight, it is more efficient to assign a width/height of `0dp` to it since it will absorb all the remaining space anyway. With a declared width/height of `0dp` it does not have to measure its own size first.
More info:
To suppress this error, use the issue id "InefficientWeight" as explained in the Suppressing Warnings and Errors section.
InflateParams
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness
Severity: Warning
Explanation: Layout Inflation without a Parent.
When inflating a layout, avoid passing in null as the parent view, since otherwise any layout parameters on the root of the inflated layout will be ignored.
More info: http://www.doubleencore.com/2013/05/layout-inflation-as-intended
To suppress this error, use the issue id "InflateParams" as explained in the Suppressing Warnings and Errors section.
InlinedApi
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Using inlined constants on older versions.
This check scans through all the Android API field references in the application and flags certain constants, such as static final integers and Strings, which were introduced in later versions. These will actually be copied into the class files rather than being referenced, which means that the value is available even when running on older devices. In some cases that's fine, and in other cases it can result in a runtime crash or incorrect behavior. It depends on the context, so consider the code carefully and device whether it's safe and can be suppressed or whether the code needs tbe guarded.
If you really want to use this API and don't need to support older devices just set the `minSdkVersion` in your `build.gradle` or `AndroidManifest.xml` files.
If your code is deliberately accessing newer APIs, and you have ensured (e.g. with conditional execution) that this code will only ever be called on a supported platform, then you can annotate your class or method with the `@TargetApi` annotation specifying the local minimum SDK to apply, such as `@TargetApi(11)`, such that this check considers 11 rather than your manifest file's minimum SDK as the required API level.
More info:
To suppress this error, use the issue id "InlinedApi" as explained in the Suppressing Warnings and Errors section.
InnerclassSeparator
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Correctness
Severity: Warning
Explanation: Inner classes should use `$` rather than `.`
When you reference an inner class in a manifest file, you must use '$' instead of '.' as the separator character, i.e. Outer$Inner instead of Outer.Inner.
(If you get this warning for a class which is not actually an inner class, it's because you are using uppercase characters in your package name, which is not conventional.)
More info:
To suppress this error, use the issue id "InnerclassSeparator" as explained in the Suppressing Warnings and Errors section.
InvalidPackage
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Package not included in Android.
This check scans through libraries looking for calls to APIs that are not included in Android.
When you create Android projects, the classpath is set up such that you can only access classes in the API packages that are included in Android. However, if you add other projects to your libs/ folder, there is no guarantee that those .jar files were built with an Android specific classpath, and in particular, they could be accessing unsupported APIs such as java.applet.
This check scans through library jars and looks for references to API packages that are not included in Android and flags these. This is only an error if your code calls one of the library classes which wind up referencing the unsupported package.
More info:
To suppress this error, use the issue id "InvalidPackage" as explained in the Suppressing Warnings and Errors section.
InvalidResourceFolder
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Invalid Resource Folder.
This lint check looks for a folder name that is not a valid resource folder name; these will be ignored and not packaged by the Android Gradle build plugin.
Note that the order of resources is very important; for example, you can't specify a language before a network code.
Similarly, note that to use 3 letter region codes, you have to use a special BCP 47 syntax: the prefix b+ followed by the BCP 47 language tag but with `+` as the individual separators instead of `-`. Therefore, for the BCP 47 language tag `nl-ABW` you have to use `b+nl+ABW`.
More info:

- http://developer.android.com/guide/topics/resources/providing-resources.html
- https://tools.ietf.org/html/bcp47

To suppress this error, use the issue id "InvalidResourceFolder" as explained in the Suppressing Warnings and Errors section.
InvalidUsesTagAttribute
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Invalid `name` attribute for `uses` element.
The <uses> element in `<automotiveApp>` should contain a valid value for the `name` attribute.
Valid values are `media` or `notification`.
More info: https://developer.android.com/training/auto/start/index.html#auto-metadata
To suppress this error, use the issue id "InvalidUsesTagAttribute" as explained in the Suppressing Warnings and Errors section.
JavascriptInterface
Disabled By: Project lint.xml file
Priority: 8 / 10
Category: Security
Severity: Error
Explanation: Missing @JavascriptInterface on methods.
As of API 17, you must annotate methods in objects registered with the `addJavascriptInterface` method with a `@JavascriptInterface` annotation.
More info: http://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object, java.lang.String)
To suppress this error, use the issue id "JavascriptInterface" as explained in the Suppressing Warnings and Errors section.
LabelFor
Disabled By: Project lint.xml file
Priority: 2 / 10
Category: Accessibility
Severity: Warning
Explanation: Missing `labelFor` attribute.
Text fields should be labelled with a `labelFor` attribute, provided your `minSdkVersion` is at least 17.
If your view is labeled but by a label in a different layout which includes this one, just suppress this warning from lint.
More info:
To suppress this error, use the issue id "LabelFor" as explained in the Suppressing Warnings and Errors section.
LocalSuppress
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Correctness
Severity: Error
Explanation: @SuppressLint on invalid element.
The `@SuppressAnnotation` is used to suppress Lint warnings in Java files. However, while many lint checks analyzes the Java source code, where they can find annotations on (for example) local variables, some checks are analyzing the `.class` files. And in class files, annotations only appear on classes, fields and methods. Annotations placed on local variables disappear. If you attempt to suppress a lint error for a class-file based lint check, the suppress annotation not work. You must move the annotation out to the surrounding method.
More info:
To suppress this error, use the issue id "LocalSuppress" as explained in the Suppressing Warnings and Errors section.
LocaleFolder
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Wrong locale name.
From the `java.util.Locale` documentation:
"Note that Java uses several deprecated two-letter codes. The Hebrew ("he") language code is rewritten as "iw", Indonesian ("id") as "in", and Yiddish ("yi") as "ji". This rewriting happens even if you construct your own Locale object, not just for instances returned by the various lookup methods.
Because of this, if you add your localized resources in for example `values-he` they will not be used, since the system will look for `values-iw` instead.
To work around this, place your resources in a `values` folder using the deprecated language code instead.
More info: http://developer.android.com/reference/java/util/Locale.html
To suppress this error, use the issue id "LocaleFolder" as explained in the Suppressing Warnings and Errors section.
LogConditional
Disabled By: Default
Priority: 5 / 10
Category: Performance
Severity: Warning
Explanation: Unconditional Logging Calls.
The BuildConfig class (available in Tools 17) provides a constant, "DEBUG", which indicates whether the code is being built in release mode or in debug mode. In release mode, you typically want to strip out all the logging calls. Since the compiler will automatically remove all code which is inside a "if (false)" check, surrounding your logging calls with a check for BuildConfig.DEBUG is a good idea.
If you really intend for the logging to be present in release mode, you can suppress this warning with a @SuppressLint annotation for the intentional logging calls.
More info:
To suppress this error, use the issue id "LogConditional" as explained in the Suppressing Warnings and Errors section.
LogTagMismatch
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness
Severity: Error
Explanation: Mismatched Log Tags.
When guarding a `Log.v(tag, ...)` call with `Log.isLoggable(tag)`, the tag passed to both calls should be the same. Similarly, the level passed in to `Log.isLoggable` should typically match the type of `Log` call, e.g. if checking level `Log.DEBUG`, the corresponding `Log` call should be `Log.d`, not `Log.i`.
More info:
To suppress this error, use the issue id "LogTagMismatch" as explained in the Suppressing Warnings and Errors section.
LongLogTag
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness
Severity: Error
Explanation: Too Long Log Tags.
Log tags are only allowed to be at most 23 tag characters long.
More info:
To suppress this error, use the issue id "LongLogTag" as explained in the Suppressing Warnings and Errors section.
MangledCRLF
Note: This issue has an associated quickfix operation in Eclipse/ADT
Disabled By: Default
Priority: 2 / 10
Category: Correctness
Severity: Error
Explanation: Mangled file line endings.
On Windows, line endings are typically recorded as carriage return plus newline: \r\n.
This detector looks for invalid line endings with repeated carriage return characters (without newlines). Previous versions of the ADT plugin could accidentally introduce these into the file, and when editing the file, the editor could produce confusing visual artifacts.
More info: https://bugs.eclipse.org/bugs/show_bug.cgi?id=375421
To suppress this error, use the issue id "MangledCRLF" as explained in the Suppressing Warnings and Errors section.
ManifestOrder
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness
Severity: Warning
Explanation: Incorrect order of elements in manifest.
The <application> tag should appear after the elements which declare which version you need, which features you need, which libraries you need, and so on. In the past there have been subtle bugs (such as themes not getting applied correctly) when the `<application>` tag appears before some of these other elements, so it's best to order your manifest in the logical dependency order.
More info:
To suppress this error, use the issue id "ManifestOrder" as explained in the Suppressing Warnings and Errors section.
MenuTitle
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability
Severity: Error
Explanation: Missing menu title.
From the action bar documentation:
"It's important that you always define android:title for each menu item — even if you don't declare that the title appear with the action item — for three reasons:
* If there's not enough room in the action bar for the action item, the menu item appears in the overflow menu and only the title appears.
* Screen readers for sight-impaired users read the menu item's title.
* If the action item appears with only the icon, a user can long-press the item to reveal a tool-tip that displays the action item's title.
The android:icon is always optional, but recommended.
More info: http://developer.android.com/guide/topics/ui/actionbar.html
To suppress this error, use the issue id "MenuTitle" as explained in the Suppressing Warnings and Errors section.
MergeRootFrame
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Performance
Severity: Warning
Explanation: FrameLayout can be replaced with `<merge>` tag.
If a `<FrameLayout>` is the root of a layout and does not provide background or padding etc, it can often be replaced with a `<merge>` tag which is slightly more efficient. Note that this depends on context, so make sure you understand how the `<merge>` tag works before proceeding.
More info: http://android-developers.blogspot.com/2009/03/android-layout-tricks-3-optimize-by.html
To suppress this error, use the issue id "MergeRootFrame" as explained in the Suppressing Warnings and Errors section.
MipmapIcons
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Use Mipmap Launcher Icons.
Launcher icons should be provided in the `mipmap` resource directory. This is the same as the `drawable` resource directory, except resources in the `mipmap` directory will not get stripped out when creating density-specific APKs.
In certain cases, the Launcher app may use a higher resolution asset (than would normally be computed for the device) to display large app shortcuts. If drawables for densities other than the device's resolution have been stripped out, then the app shortcut could appear blurry.
To fix this, move your launcher icons from `drawable-`dpi to `mipmap-`dpi and change references from @drawable/ and R.drawable to @mipmap/ and R.mipmap.
In Android Studio this lint warning has a quickfix to perform this automatically.
More info:
To suppress this error, use the issue id "MipmapIcons" as explained in the Suppressing Warnings and Errors section.
MissingApplicationIcon
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Missing application icon.
You should set an icon for the application as whole because there is no default. This attribute must be set as a reference to a drawable resource containing the image (for example `@drawable/icon`).
More info: http://developer.android.com/tools/publishing/preparing.html#publishing-configure
To suppress this error, use the issue id "MissingApplicationIcon" as explained in the Suppressing Warnings and Errors section.
MissingId
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness
Severity: Warning
Explanation: Fragments should specify an `id` or `tag`
If you do not specify an android:id or an android:tag attribute on a <fragment> element, then if the activity is restarted (for example for an orientation rotation) you may lose state. From the fragment documentation:
"Each fragment requires a unique identifier that the system can use to restore the fragment if the activity is restarted (and which you can use to capture the fragment to perform transactions, such as remove it).
* Supply the android:id attribute with a unique ID.
* Supply the android:tag attribute with a unique string.
If you provide neither of the previous two, the system uses the ID of the container view.
More info: http://developer.android.com/guide/components/fragments.html
To suppress this error, use the issue id "MissingId" as explained in the Suppressing Warnings and Errors section.
MissingIntentFilterForMediaSearch
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Missing intent-filter with action `android.media.action.MEDIA_PLAY_FROM_SEARCH`
To support voice searches on Android Auto, you should also register an `intent-filter` for the action `android.media.action.MEDIA_PLAY_FROM_SEARCH`.
To do this, add
`<intent-filter>`
`<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />`
`</intent-filter>`
to your `<activity>` or `<service>`.
More info: https://developer.android.com/training/auto/audio/index.html#support_voice
To suppress this error, use the issue id "MissingIntentFilterForMediaSearch" as explained in the Suppressing Warnings and Errors section.
MissingLeanbackLauncher
Disabled By: Project lint.xml file
Priority: 8 / 10
Category: Correctness
Severity: Error
Explanation: Missing Leanback Launcher Intent Filter.
An application intended to run on TV devices must declare a launcher activity for TV in its manifest using a `android.intent.category.LEANBACK_LAUNCHER` intent filter.
More info: https://developer.android.com/training/tv/start/start.html#tv-activity
To suppress this error, use the issue id "MissingLeanbackLauncher" as explained in the Suppressing Warnings and Errors section.
MissingLeanbackSupport
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Missing Leanback Support.
The manifest should declare the use of the Leanback user interface required by Android TV.
To fix this, add
`<uses-feature android:name="android.software.leanback" android:required="false" />`
to your manifest.
More info: https://developer.android.com/training/tv/start/start.html#leanback-req
To suppress this error, use the issue id "MissingLeanbackSupport" as explained in the Suppressing Warnings and Errors section.
MissingMediaBrowserServiceIntentFilter
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Missing intent-filter with action `android.media.browse.MediaBrowserService`.
An Automotive Media App requires an exported service that extends `android.service.media.MediaBrowserService` with an `intent-filter` for the action `android.media.browse.MediaBrowserService` to be able to browse and play media.
To do this, add
`<intent-filter>`
`<action android:name="android.media.browse.MediaBrowserService" />`
`</intent-filter>`
to the service that extends `android.service.media.MediaBrowserService`
More info: https://developer.android.com/training/auto/audio/index.html#config_manifest
To suppress this error, use the issue id "MissingMediaBrowserServiceIntentFilter" as explained in the Suppressing Warnings and Errors section.
MissingOnPlayFromSearch
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Missing `onPlayFromSearch`.
To support voice searches on Android Auto, in addition to adding an `intent-filter` for the action `onPlayFromSearch`, you also need to override and implement `onPlayFromSearch(String query, Bundle bundle)`
More info: https://developer.android.com/training/auto/audio/index.html#support_voice
To suppress this error, use the issue id "MissingOnPlayFromSearch" as explained in the Suppressing Warnings and Errors section.
MissingPermission
Disabled By: Project lint.xml file
Priority: 9 / 10
Category: Correctness
Severity: Error
Explanation: Missing Permissions.
This check scans through your code and libraries and looks at the APIs being used, and checks this against the set of permissions required to access those APIs. If the code using those APIs is called at runtime, then the program will crash.
Furthermore, for permissions that are revocable (with targetSdkVersion 23), client code must also be prepared to handle the calls throwing an exception if the user rejects the request for permission at runtime.
More info:
To suppress this error, use the issue id "MissingPermission" as explained in the Suppressing Warnings and Errors section.
MissingPrefix
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Missing Android XML namespace.
Most Android views have attributes in the Android namespace. When referencing these attributes you must include the namespace prefix, or your attribute will be interpreted by `aapt` as just a custom attribute.
Similarly, in manifest files, nearly all attributes should be in the `android:` namespace.
More info:
To suppress this error, use the issue id "MissingPrefix" as explained in the Suppressing Warnings and Errors section.
MissingQuantity
Disabled By: Project lint.xml file
Priority: 8 / 10
Category: Correctness:Messages
Severity: Error
Explanation: Missing quantity translation.
Different languages have different rules for grammatical agreement with quantity. In English, for example, the quantity 1 is a special case. We write "1 book", but for any other quantity we'd write "n books". This distinction between singular and plural is very common, but other languages make finer distinctions.
This lint check looks at each translation of a `<plural>` and makes sure that all the quantity strings considered by the given language are provided by this translation.
For example, an English translation must provide a string for `quantity="one"`. Similarly, a Czech translation must provide a string for `quantity="few"`.
More info: http://developer.android.com/guide/topics/resources/string-resource.html#Plurals
To suppress this error, use the issue id "MissingQuantity" as explained in the Suppressing Warnings and Errors section.
MissingRegistered
Disabled By: Project lint.xml file
Priority: 8 / 10
Category: Correctness
Severity: Error
Explanation: Missing registered class.
If a class is referenced in the manifest, it must also exist in the project (or in one of the libraries included by the project. This check helps uncover typos in registration names, or attempts to rename or move classes without updating the manifest file properly.
More info: http://developer.android.com/guide/topics/manifest/manifest-intro.html
To suppress this error, use the issue id "MissingRegistered" as explained in the Suppressing Warnings and Errors section.
MissingSuperCall
Disabled By: Project lint.xml file
Priority: 9 / 10
Category: Correctness
Severity: Error
Explanation: Missing Super Call.
Some methods, such as `View#onDetachedFromWindow`, require that you also call the super implementation as part of your method.
More info:
To suppress this error, use the issue id "MissingSuperCall" as explained in the Suppressing Warnings and Errors section.
MissingTvBanner
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness
Severity: Warning
Explanation: TV Missing Banner.
A TV application must provide a home screen banner for each localization if it includes a Leanback launcher intent filter. The banner is the app launch point that appears on the home screen in the apps and games rows.
More info: http://developer.android.com/training/tv/start/start.html#banner
To suppress this error, use the issue id "MissingTvBanner" as explained in the Suppressing Warnings and Errors section.
MissingVersion
Disabled By: Project lint.xml file
Priority: 2 / 10
Category: Correctness
Severity: Warning
Explanation: Missing application name/version.
You should define the version information for your application.
`android:versionCode`: An integer value that represents the version of the application code, relative to other versions.
`android:versionName`: A string value that represents the release version of the application code, as it should be shown to users.
More info: http://developer.android.com/tools/publishing/versioning.html#appversioning
To suppress this error, use the issue id "MissingVersion" as explained in the Suppressing Warnings and Errors section.
NegativeMargin
Disabled By: Default
Priority: 4 / 10
Category: Usability
Severity: Warning
Explanation: Negative Margins.
Margin values should be positive. Negative values are generally a sign that you are making assumptions about views surrounding the current one, or may be tempted to turn off child clipping to allow a view to escape its parent. Turning off child clipping to do this not only leads to poor graphical performance, it also results in wrong touch event handling since touch events are based strictly on a chain of parent-rect hit tests. Finally, making assumptions about the size of strings can lead to localization problems.
More info:
To suppress this error, use the issue id "NegativeMargin" as explained in the Suppressing Warnings and Errors section.
NestedScrolling
Disabled By: Project lint.xml file
Priority: 7 / 10
Category: Correctness
Severity: Warning
Explanation: Nested scrolling widgets.
A scrolling widget such as a `ScrollView` should not contain any nested scrolling widgets since this has various usability issues
More info:
To suppress this error, use the issue id "NestedScrolling" as explained in the Suppressing Warnings and Errors section.
NestedWeights
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Performance
Severity: Warning
Explanation: Nested layout weights.
Layout weights require a widget to be measured twice. When a LinearLayout with non-zero weights is nested inside another LinearLayout with non-zero weights, then the number of measurements increase exponentially.
More info:
To suppress this error, use the issue id "NestedWeights" as explained in the Suppressing Warnings and Errors section.
NewApi
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Calling new methods on older versions.
This check scans through all the Android API calls in the application and warns about any calls that are not available on all versions targeted by this application (according to its minimum SDK attribute in the manifest).
If you really want to use this API and don't need to support older devices just set the `minSdkVersion` in your `build.gradle` or `AndroidManifest.xml` files.
If your code is deliberately accessing newer APIs, and you have ensured (e.g. with conditional execution) that this code will only ever be called on a supported platform, then you can annotate your class or method with the `@TargetApi` annotation specifying the local minimum SDK to apply, such as `@TargetApi(11)`, such that this check considers 11 rather than your manifest file's minimum SDK as the required API level.
If you are deliberately setting `android:` attributes in style definitions, make sure you place this in a `values-vNN` folder in order to avoid running into runtime conflicts on certain devices where manufacturers have added custom attributes whose ids conflict with the new ones on later platforms.
Similarly, you can use tools:targetApi="11" in an XML file to indicate that the element will only be inflated in an adequate context.
More info:
To suppress this error, use the issue id "NewApi" as explained in the Suppressing Warnings and Errors section.
NewerVersionAvailable
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Default
Priority: 4 / 10
Category: Correctness
Severity: Warning
Explanation: Newer Library Versions Available.
This detector checks with a central repository to see if there are newer versions available for the dependencies used by this project. This is similar to the `GradleDependency` check, which checks for newer versions available in the Android SDK tools and libraries, but this works with any MavenCentral dependency, and connects to the library every time, which makes it more flexible but also much slower.
More info:
To suppress this error, use the issue id "NewerVersionAvailable" as explained in the Suppressing Warnings and Errors section.
ObsoleteLayoutParam
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Performance
Severity: Warning
Explanation: Obsolete layout params.
The given layout_param is not defined for the given layout, meaning it has no effect. This usually happens when you change the parent layout or move view code around without updating the layout params. This will cause useless attribute processing at runtime, and is misleading for others reading the layout so the parameter should be removed.
More info:
To suppress this error, use the issue id "ObsoleteLayoutParam" as explained in the Suppressing Warnings and Errors section.
OldTargetApi
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Target SDK attribute is not targeting latest version.
When your application runs on a version of Android that is more recent than your `targetSdkVersion` specifies that it has been tested with, various compatibility modes kick in. This ensures that your application continues to work, but it may look out of place. For example, if the `targetSdkVersion` is less than 14, your app may get an option button in the UI.
To fix this issue, set the `targetSdkVersion` to the highest available value. Then test your app to make sure everything works correctly. You may want to consult the compatibility notes to see what changes apply to each version you are adding support for: http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
More info: http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
To suppress this error, use the issue id "OldTargetApi" as explained in the Suppressing Warnings and Errors section.
OnClick
Disabled By: Project lint.xml file
Priority: 10 / 10
Category: Correctness
Severity: Error
Explanation: `onClick` method does not exist.
The `onClick` attribute value should be the name of a method in this View's context to invoke when the view is clicked. This name must correspond to a public method that takes exactly one parameter of type `View`.
Must be a string value, using '\;' to escape characters such as '\n' or '\uxxxx' for a unicode character.
More info:
To suppress this error, use the issue id "OnClick" as explained in the Suppressing Warnings and Errors section.
Orientation
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 2 / 10
Category: Correctness
Severity: Error
Explanation: Missing explicit orientation.
The default orientation of a LinearLayout is horizontal. It's pretty easy to believe that the layout is vertical, add multiple children to it, and wonder why only the first child is visible (when the subsequent children are off screen to the right). This lint rule helps pinpoint this issue by warning whenever a LinearLayout is used with an implicit orientation and multiple children.
It also checks for empty LinearLayouts without an `orientation` attribute that also defines an `id` attribute. This catches the scenarios where children will be added to the `LinearLayout` dynamically.
More info:
To suppress this error, use the issue id "Orientation" as explained in the Suppressing Warnings and Errors section.
Overdraw
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Performance
Severity: Warning
Explanation: Overdraw: Painting regions more than once.
If you set a background drawable on a root view, then you should use a custom theme where the theme background is null. Otherwise, the theme background will be painted first, only to have your custom background completely cover it; this is called "overdraw".
NOTE: This detector relies on figuring out which layouts are associated with which activities based on scanning the Java code, and it's currently doing that using an inexact pattern matching algorithm. Therefore, it can incorrectly conclude which activity the layout is associated with and then wrongly complain that a background-theme is hidden.
If you want your custom background on multiple pages, then you should consider making a custom theme with your custom background and just using that theme instead of a root element background.
Of course it's possible that your custom drawable is translucent and you want it to be mixed with the background. However, you will get better performance if you pre-mix the background with your drawable and use that resulting image or color as a custom theme background instead.
More info:
To suppress this error, use the issue id "Overdraw" as explained in the Suppressing Warnings and Errors section.
Override
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Method conflicts with new inherited method.
Suppose you are building against Android API 8, and you've subclassed Activity. In your subclass you add a new method called `isDestroyed`(). At some later point, a method of the same name and signature is added to Android. Your method will now override the Android method, and possibly break its contract. Your method is not calling `super.isDestroyed()`, since your compilation target doesn't know about the method.
The above scenario is what this lint detector looks for. The above example is real, since `isDestroyed()` was added in API 17, but it will be true for any method you have added to a subclass of an Android class where your build target is lower than the version the method was introduced in.
To fix this, either rename your method, or if you are really trying to augment the builtin method if available, switch to a higher build target where you can deliberately add `@Override` on your overriding method, and call `super` if appropriate etc.
More info:
To suppress this error, use the issue id "Override" as explained in the Suppressing Warnings and Errors section.
PackageManagerGetSignatures
Disabled By: Project lint.xml file
Priority: 8 / 10
Category: Security
Severity: Information
Explanation: Potential Multiple Certificate Exploit.
Improper validation of app signatures could lead to issues where a malicious app submits itself to the Play Store with both its real certificate and a fake certificate and gains access to functionality or information it shouldn't have due to another application only checking for the fake certificate and ignoring the rest. Please make sure to validate all signatures returned by this method.
More info: https://bluebox.com/technical/android-fake-id-vulnerability/
To suppress this error, use the issue id "PackageManagerGetSignatures" as explained in the Suppressing Warnings and Errors section.
ParcelCreator
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Usability
Severity: Error
Explanation: Missing Parcelable `CREATOR` field.
According to the `Parcelable` interface documentation, "Classes implementing the Parcelable interface must also have a static field called `CREATOR`, which is an object implementing the `Parcelable.Creator` interface."
More info: http://developer.android.com/reference/android/os/Parcelable.html
To suppress this error, use the issue id "ParcelCreator" as explained in the Suppressing Warnings and Errors section.
PermissionImpliesUnsupportedHardware
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Correctness
Severity: Warning
Explanation: Permission Implies Unsupported Hardware.
The <uses-permission> element should not require a permission that implies an unsupported TV hardware feature. Google Play assumes that certain hardware related permissions indicate that the underlying hardware features are required by default. To fix the issue, consider declaring the corresponding uses-feature element with required="false" attribute.
More info: http://developer.android.com/guide/topics/manifest/uses-feature-element.html#permissions
To suppress this error, use the issue id "PermissionImpliesUnsupportedHardware" as explained in the Suppressing Warnings and Errors section.
PluralsCandidate
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness:Messages
Severity: Warning
Explanation: Potential Plurals.
This lint check looks for potential errors in internationalization where you have translated a message which involves a quantity and it looks like other parts of the string may need grammatical changes.
For example, rather than something like this:
<string name="try_again">Try again in %d seconds.</string>
you should be using a plural:
<plurals name="try_again">
<item quantity="one">Try again in %d second</item>
<item quantity="other">Try again in %d seconds</item>
</plurals>
This will ensure that in other languages the right set of translations are provided for the different quantity classes.
(This check depends on some heuristics, so it may not accurately determine whether a string really should be a quantity. You can use tools:ignore to filter out false positives.
More info: http://developer.android.com/guide/topics/resources/string-resource.html#Plurals
To suppress this error, use the issue id "PluralsCandidate" as explained in the Suppressing Warnings and Errors section.
PrivateResource
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Correctness
Severity: Warning
Explanation: Using private resources.
Private resources should not be referenced; the may not be present everywhere, and even where they are they may disappear without notice.
To fix this, copy the resource into your own project instead.
More info:
To suppress this error, use the issue id "PrivateResource" as explained in the Suppressing Warnings and Errors section.
ProguardSplit
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Correctness
Severity: Warning
Explanation: Proguard.cfg file contains generic Android rules.
Earlier versions of the Android tools bundled a single `proguard.cfg` file containing a ProGuard configuration file suitable for Android shrinking and obfuscation. However, that version was copied into new projects, which means that it does not continue to get updated as we improve the default ProGuard rules for Android.
In the new version of the tools, we have split the ProGuard configuration into two halves:
* A simple configuration file containing only project-specific flags, in your project
* A generic configuration file containing the recommended set of ProGuard options for Android projects. This generic file lives in the SDK install directory which means that it gets updated along with the tools.
In order for this to work, the proguard.config property in the `project.properties` file now refers to a path, so you can reference both the generic file as well as your own (and any additional files too).
To migrate your project to the new setup, create a new `proguard-project.txt` file in your project containing any project specific ProGuard flags as well as any customizations you have made, then update your project.properties file to contain:
`proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt`
More info:
To suppress this error, use the issue id "ProguardSplit" as explained in the Suppressing Warnings and Errors section.
PropertyEscape
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Incorrect property escapes.
All backslashes and colons in .property files must be escaped with a backslash (\). This means that when writing a Windows path, you must escape the file separators, so the path \My\Files should be written as `key=\\My\\Files.`
More info:
To suppress this error, use the issue id "PropertyEscape" as explained in the Suppressing Warnings and Errors section.
ProtectedPermissions
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness
Severity: Error
Explanation: Using system app permission.
Permissions with the protection level signature or signatureOrSystem are only granted to system apps. If an app is a regular non-system app, it will never be able to use these permissions.
More info:
To suppress this error, use the issue id "ProtectedPermissions" as explained in the Suppressing Warnings and Errors section.
PxUsage
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 2 / 10
Category: Correctness
Severity: Warning
Explanation: Using 'px' dimension.
For performance reasons and to keep the code simpler, the Android system uses pixels as the standard unit for expressing dimension or coordinate values. That means that the dimensions of a view are always expressed in the code using pixels, but always based on the current screen density. For instance, if `myView.getWidth()` returns 10, the view is 10 pixels wide on the current screen, but on a device with a higher density screen, the value returned might be 15. If you use pixel values in your application code to work with bitmaps that are not pre-scaled for the current screen density, you might need to scale the pixel values that you use in your code to match the un-scaled bitmap source.
More info: http://developer.android.com/guide/practices/screens_support.html#screen-independence
To suppress this error, use the issue id "PxUsage" as explained in the Suppressing Warnings and Errors section.
Range
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Outside Range.
Some parameters are required to in a particular numerical range; this check makes sure that arguments passed fall within the range. For arrays, Strings and collections this refers to the size or length.
More info:
To suppress this error, use the issue id "Range" as explained in the Suppressing Warnings and Errors section.
Recycle
Disabled By: Project lint.xml file
Priority: 7 / 10
Category: Performance
Severity: Warning
Explanation: Missing `recycle()` calls.
Many resources, such as TypedArrays, VelocityTrackers, etc., should be recycled (with a `recycle()` call) after use. This lint check looks for missing `recycle()` calls.
More info:
To suppress this error, use the issue id "Recycle" as explained in the Suppressing Warnings and Errors section.
Registered
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Class is not registered in the manifest.
Activities, services and content providers should be registered in the `AndroidManifest.xml` file using `<activity>`, `<service>` and `<provider>` tags.
If your activity is simply a parent class intended to be subclassed by other "real" activities, make it an abstract class.
More info: http://developer.android.com/guide/topics/manifest/manifest-intro.html
To suppress this error, use the issue id "Registered" as explained in the Suppressing Warnings and Errors section.
RelativeOverlap
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Internationalization
Severity: Warning
Explanation: Overlapping items in RelativeLayout.
If relative layout has text or button items aligned to left and right sides they can overlap each other due to localized text expansion unless they have mutual constraints like `toEndOf`/`toStartOf`.
More info:
To suppress this error, use the issue id "RelativeOverlap" as explained in the Suppressing Warnings and Errors section.
RequiredSize
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Correctness
Severity: Error
Explanation: Missing `layout_width` or `layout_height` attributes.
All views must specify an explicit `layout_width` and `layout_height` attribute. There is a runtime check for this, so if you fail to specify a size, an exception is thrown at runtime.
It's possible to specify these widths via styles as well. GridLayout, as a special case, does not require you to specify a size.
More info:
To suppress this error, use the issue id "RequiredSize" as explained in the Suppressing Warnings and Errors section.
ResourceAsColor
Disabled By: Project lint.xml file
Priority: 7 / 10
Category: Correctness
Severity: Error
Explanation: Should pass resolved color instead of resource id.
Methods that take a color in the form of an integer should be passed an RGB triple, not the actual color resource id. You must call `getResources().getColor(resource)` to resolve the actual color value first.
More info:
To suppress this error, use the issue id "ResourceAsColor" as explained in the Suppressing Warnings and Errors section.
RtlCompat
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Bi-directional Text
Severity: Error
Explanation: Right-to-left text compatibility issues.
API 17 adds a `textAlignment` attribute to specify text alignment. However, if you are supporting older versions than API 17, you must also specify a gravity or layout_gravity attribute, since older platforms will ignore the `textAlignment` attribute.
More info:
To suppress this error, use the issue id "RtlCompat" as explained in the Suppressing Warnings and Errors section.
RtlEnabled
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Bi-directional Text
Severity: Warning
Explanation: Using RTL attributes without enabling RTL support.
To enable right-to-left support, when running on API 17 and higher, you must set the `android:supportsRtl` attribute in the manifest `<application>` element.
If you have started adding RTL attributes, but have not yet finished the migration, you can set the attribute to false to satisfy this lint check.
More info:
To suppress this error, use the issue id "RtlEnabled" as explained in the Suppressing Warnings and Errors section.
RtlHardcoded
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Bi-directional Text
Severity: Warning
Explanation: Using left/right instead of start/end attributes.
Using `Gravity#LEFT` and `Gravity#RIGHT` can lead to problems when a layout is rendered in locales where text flows from right to left. Use `Gravity#START` and `Gravity#END` instead. Similarly, in XML `gravity` and `layout_gravity` attributes, use `start` rather than `left`.
For XML attributes such as paddingLeft and `layout_marginLeft`, use `paddingStart` and `layout_marginStart`. NOTE: If your `minSdkVersion` is less than 17, you should add both the older left/right attributes as well as the new start/right attributes. On older platforms, where RTL is not supported and the start/right attributes are unknown and therefore ignored, you need the older left/right attributes. There is a separate lint check which catches that type of error.
(Note: For `Gravity#LEFT` and `Gravity#START`, you can use these constants even when targeting older platforms, because the `start` bitmask is a superset of the `left` bitmask. Therefore, you can use `gravity="start"` rather than `gravity="left|start"`.)
More info:
To suppress this error, use the issue id "RtlHardcoded" as explained in the Suppressing Warnings and Errors section.
RtlSymmetry
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Bi-directional Text
Severity: Warning
Explanation: Padding and margin symmetry.
If you specify padding or margin on the left side of a layout, you should probably also specify padding on the right side (and vice versa) for right-to-left layout symmetry.
More info:
To suppress this error, use the issue id "RtlSymmetry" as explained in the Suppressing Warnings and Errors section.
SQLiteString
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness
Severity: Warning
Explanation: Using STRING instead of TEXT.
In SQLite, any column can store any data type; the declared type for a column is more of a hint as to what the data should be cast to when stored.
There are many ways to store a string. `TEXT`, `VARCHAR`, `CHARACTER` and `CLOB` are string types, but `STRING` is not. Columns defined as STRING are actually numeric.
If you try to store a value in a numeric column, SQLite will try to cast it to a float or an integer before storing. If it can't, it will just store it as a string.
This can lead to some subtle bugs. For example, when SQLite encounters a string like `1234567e1234`, it will parse it as a float, but the result will be out of range for floating point numbers, so `Inf` will be stored! Similarly, strings that look like integers will lose leading zeroes.
To fix this, you can change your schema to use a `TEXT` type instead.
More info: https://www.sqlite.org/datatype3.html
To suppress this error, use the issue id "SQLiteString" as explained in the Suppressing Warnings and Errors section.
SSLCertificateSocketFactoryCreateSocket
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Security
Severity: Warning
Explanation: Insecure call to `SSLCertificateSocketFactory.createSocket()`
When `SSLCertificateSocketFactory.createSocket()` is called with an `InetAddress` as the first parameter, TLS/SSL hostname verification is not performed, which could result in insecure network traffic caused by trusting arbitrary hostnames in TLS/SSL certificates presented by peers. In this case, developers must ensure that the `InetAddress` is explicitly verified against the certificate through other means, such as by calling `SSLCertificateSocketFactory.getDefaultHostnameVerifier() to get a `HostnameVerifier` and calling `HostnameVerifier.verify()`.
More info:
To suppress this error, use the issue id "SSLCertificateSocketFactoryCreateSocket" as explained in the Suppressing Warnings and Errors section.
SSLCertificateSocketFactoryGetInsecure
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Security
Severity: Warning
Explanation: Call to `SSLCertificateSocketFactory.getInsecure()`
The `SSLCertificateSocketFactory.getInsecure()` method returns an SSLSocketFactory with all TLS/SSL security checks disabled, which could result in insecure network traffic caused by trusting arbitrary TLS/SSL certificates presented by peers. This method should be avoided unless needed for a special circumstance such as debugging. Instead, `SSLCertificateSocketFactory.getDefault()` should be used.
More info:
To suppress this error, use the issue id "SSLCertificateSocketFactoryGetInsecure" as explained in the Suppressing Warnings and Errors section.
ScrollViewCount
Disabled By: Project lint.xml file
Priority: 8 / 10
Category: Correctness
Severity: Warning
Explanation: ScrollViews can have only one child.
ScrollViews can only have one child widget. If you want more children, wrap them in a container layout.
More info:
To suppress this error, use the issue id "ScrollViewCount" as explained in the Suppressing Warnings and Errors section.
ScrollViewSize
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 7 / 10
Category: Correctness
Severity: Warning
Explanation: ScrollView size validation.
ScrollView children must set their `layout_width` or `layout_height` attributes to `wrap_content` rather than `fill_parent` or `match_parent` in the scrolling dimension
More info:
To suppress this error, use the issue id "ScrollViewSize" as explained in the Suppressing Warnings and Errors section.
SdCardPath
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Hardcoded reference to `/sdcard`
Your code should not reference the `/sdcard` path directly; instead use `Environment.getExternalStorageDirectory().getPath()`.
Similarly, do not reference the `/data/data/` path directly; it can vary in multi-user scenarios. Instead, use `Context.getFilesDir().getPath()`.
More info: http://developer.android.com/guide/topics/data/data-storage.html#filesExternal
To suppress this error, use the issue id "SdCardPath" as explained in the Suppressing Warnings and Errors section.
SecureRandom
Disabled By: Project lint.xml file
Priority: 9 / 10
Category: Security
Severity: Warning
Explanation: Using a fixed seed with `SecureRandom`
Specifying a fixed seed will cause the instance to return a predictable sequence of numbers. This may be useful for testing but it is not appropriate for secure use.
More info: http://developer.android.com/reference/java/security/SecureRandom.html
To suppress this error, use the issue id "SecureRandom" as explained in the Suppressing Warnings and Errors section.
SelectableText
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Default
Priority: 7 / 10
Category: Usability
Severity: Warning
Explanation: Dynamic text should probably be selectable.
If a `<TextView>` is used to display data, the user might want to copy that data and paste it elsewhere. To allow this, the `<TextView>` should specify `android:textIsSelectable="true"`.
This lint check looks for TextViews which are likely to be displaying data: views whose text is set dynamically. This value will be ignored on platforms older than API 11, so it is okay to set it regardless of your `minSdkVersion`.
More info:
To suppress this error, use the issue id "SelectableText" as explained in the Suppressing Warnings and Errors section.
SetJavaScriptEnabled
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Security
Severity: Warning
Explanation: Using `setJavaScriptEnabled`
Your code should not invoke `setJavaScriptEnabled` if you are not sure that your app really requires JavaScript support.
More info: http://developer.android.com/guide/practices/security.html
To suppress this error, use the issue id "SetJavaScriptEnabled" as explained in the Suppressing Warnings and Errors section.
SetTextI18n
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Internationalization
Severity: Warning
Explanation: TextView Internationalization.
When calling `TextView#setText`
* Never call `Number#toString()` to format numbers; it will not handle fraction separators and locale-specific digits properly. Consider using `String#format` with proper format specifications (`%d` or `%f`) instead.
* Do not pass a string literal (e.g. "Hello") to display text. Hardcoded text can not be properly translated to other languages. Consider using Android resource strings instead.
* Do not build messages by concatenating text chunks. Such messages can not be properly translated.
More info: http://developer.android.com/guide/topics/resources/localization.html
To suppress this error, use the issue id "SetTextI18n" as explained in the Suppressing Warnings and Errors section.
SetWorldReadable
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Security
Severity: Warning
Explanation: `File.setReadable()` used to make file world-readable.
Setting files world-readable is very dangerous, and likely to cause security holes in applications. It is strongly discouraged; instead, applications should use more formal mechanisms for interactions such as `ContentProvider`, `BroadcastReceiver`, and `Service`.
More info:
To suppress this error, use the issue id "SetWorldReadable" as explained in the Suppressing Warnings and Errors section.
SetWorldWritable
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Security
Severity: Warning
Explanation: `File.setWritable()` used to make file world-writable.
Setting files world-writable is very dangerous, and likely to cause security holes in applications. It is strongly discouraged; instead, applications should use more formal mechanisms for interactions such as `ContentProvider`, `BroadcastReceiver`, and `Service`.
More info:
To suppress this error, use the issue id "SetWorldWritable" as explained in the Suppressing Warnings and Errors section.
ShiftFlags
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Correctness
Severity: Warning
Explanation: Dangerous Flag Constant Declaration.
When defining multiple constants for use in flags, the recommended style is to use the form `1 << 2`, `1 << 3`, `1 << 4` and so on to ensure that the constants are unique and non-overlapping.
More info:
To suppress this error, use the issue id "ShiftFlags" as explained in the Suppressing Warnings and Errors section.
ShortAlarm
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Short or Frequent Alarm.
Frequent alarms are bad for battery life. As of API 22, the `AlarmManager` will override near-future and high-frequency alarm requests, delaying the alarm at least 5 seconds into the future and ensuring that the repeat interval is at least 60 seconds.
If you really need to do work sooner than 5 seconds, post a delayed message or runnable to a Handler.
More info:
To suppress this error, use the issue id "ShortAlarm" as explained in the Suppressing Warnings and Errors section.
ShowToast
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Toast created but not shown.
`Toast.makeText()` creates a `Toast` but does not show it. You must call `show()` on the resulting object to actually make the `Toast` appear.
More info:
To suppress this error, use the issue id "ShowToast" as explained in the Suppressing Warnings and Errors section.
SignatureOrSystemPermissions
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Security
Severity: Warning
Explanation: signatureOrSystem permissions declared.
The `signature` protection level should probably be sufficient for most needs and works regardless of where applications are installed. The `signatureOrSystem` level is used for certain situations where multiple vendors have applications built into a system image and need to share specific features explicitly because they are being built together.
More info:
To suppress this error, use the issue id "SignatureOrSystemPermissions" as explained in the Suppressing Warnings and Errors section.
SimpleDateFormat
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Implied locale in date format.
Almost all callers should use `getDateInstance()`, `getDateTimeInstance()`, or `getTimeInstance()` to get a ready-made instance of SimpleDateFormat suitable for the user's locale. The main reason you'd create an instance this class directly is because you need to format/parse a specific machine-readable format, in which case you almost certainly want to explicitly ask for US to ensure that you get ASCII digits (rather than, say, Arabic digits).
Therefore, you should either use the form of the SimpleDateFormat constructor where you pass in an explicit locale, such as Locale.US, or use one of the get instance methods, or suppress this error if really know what you are doing.
More info: http://developer.android.com/reference/java/text/SimpleDateFormat.html
To suppress this error, use the issue id "SimpleDateFormat" as explained in the Suppressing Warnings and Errors section.
SmallSp
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Usability
Severity: Warning
Explanation: Text size is too small.
Avoid using sizes smaller than 12sp.
More info:
To suppress this error, use the issue id "SmallSp" as explained in the Suppressing Warnings and Errors section.
SpUsage
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Correctness
Severity: Warning
Explanation: Using `dp` instead of `sp` for text sizes.
When setting text sizes, you should normally use `sp`, or "scale-independent pixels". This is like the `dp` unit, but it is also scaled by the user's font size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and the user's preference.
There are cases where you might need to use `dp`; typically this happens when the text is in a container with a specific dp-size. This will prevent the text from spilling outside the container. Note however that this means that the user's font size settings are not respected, so consider adjusting the layout itself to be more flexible.
More info: http://developer.android.com/training/multiscreen/screendensities.html
To suppress this error, use the issue id "SpUsage" as explained in the Suppressing Warnings and Errors section.
StateListReachable
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness
Severity: Warning
Explanation: Unreachable state in a `<selector>`
In a selector, only the last child in the state list should omit a state qualifier. If not, all subsequent items in the list will be ignored since the given item will match all.
More info:
To suppress this error, use the issue id "StateListReachable" as explained in the Suppressing Warnings and Errors section.
StopShip
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Default
Priority: 10 / 10
Category: Correctness
Severity: Warning
Explanation: Code contains `STOPSHIP` marker.
Using the comment `// STOPSHIP` can be used to flag code that is incomplete but checked in. This comment marker can be used to indicate that the code should not be shipped until the issue is addressed, and lint will look for these.
More info:
To suppress this error, use the issue id "StopShip" as explained in the Suppressing Warnings and Errors section.
StringFormatCount
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness:Messages
Severity: Warning
Explanation: Formatting argument types incomplete or inconsistent.
When a formatted string takes arguments, it usually needs to reference the same arguments in all translations (or all arguments if there are no translations.
There are cases where this is not the case, so this issue is a warning rather than an error by default. However, this usually happens when a language is not translated or updated correctly.
More info:
To suppress this error, use the issue id "StringFormatCount" as explained in the Suppressing Warnings and Errors section.
StringFormatInvalid
Disabled By: Project lint.xml file
Priority: 9 / 10
Category: Correctness:Messages
Severity: Error
Explanation: Invalid format string.
If a string contains a '%' character, then the string may be a formatting string which will be passed to `String.format` from Java code to replace each '%' occurrence with specific values.
This lint warning checks for two related problems:
(1) Formatting strings that are invalid, meaning that `String.format` will throw exceptions at runtime when attempting to use the format string.
(2) Strings containing '%' that are not formatting strings getting passed to a `String.format` call. In this case the '%' will need to be escaped as '%%'.
NOTE: Not all Strings which look like formatting strings are intended for use by `String.format`; for example, they may contain date formats intended for `android.text.format.Time#format()`. Lint cannot always figure out that a String is a date format, so you may get false warnings in those scenarios. See the suppress help topic for information on how to suppress errors in that case.
More info:
To suppress this error, use the issue id "StringFormatInvalid" as explained in the Suppressing Warnings and Errors section.
StringFormatMatches
Disabled By: Project lint.xml file
Priority: 9 / 10
Category: Correctness:Messages
Severity: Error
Explanation: `String.format` string doesn't match the XML format string.
This lint check ensures the following:
(1) If there are multiple translations of the format string, then all translations use the same type for the same numbered arguments
(2) The usage of the format string in Java is consistent with the format string, meaning that the parameter types passed to String.format matches those in the format string.
More info:
To suppress this error, use the issue id "StringFormatMatches" as explained in the Suppressing Warnings and Errors section.
StringShouldBeInt
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 8 / 10
Category: Correctness
Severity: Error
Explanation: String should be int.
The properties `compileSdkVersion`, `minSdkVersion` and `targetSdkVersion` are usually numbers, but can be strings when you are using an add-on (in the case of `compileSdkVersion`) or a preview platform (for the other two properties).
However, you can not use a number as a string (e.g. "19" instead of 19); that will result in a platform not found error message at build/sync time.
More info:
To suppress this error, use the issue id "StringShouldBeInt" as explained in the Suppressing Warnings and Errors section.
Suspicious0dp
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Suspicious 0dp dimension.
Using 0dp as the width in a horizontal LinearLayout with weights is a useful trick to ensure that only the weights (and not the intrinsic sizes) are used when sizing the children.
However, if you use 0dp for the opposite dimension, the view will be invisible. This can happen if you change the orientation of a layout without also flipping the 0dp dimension in all the children.
More info:
To suppress this error, use the issue id "Suspicious0dp" as explained in the Suppressing Warnings and Errors section.
SuspiciousImport
Disabled By: Project lint.xml file
Priority: 9 / 10
Category: Correctness
Severity: Warning
Explanation: '`import android.R`' statement.
Importing `android.R` is usually not intentional; it sometimes happens when you use an IDE and ask it to automatically add imports at a time when your project's R class it not present.
Once the import is there you might get a lot of "confusing" error messages because of course the fields available on `android.R` are not the ones you'd expect from just looking at your own `R` class.
More info:
To suppress this error, use the issue id "SuspiciousImport" as explained in the Suppressing Warnings and Errors section.
TextFields
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability
Severity: Warning
Explanation: Missing `inputType` or `hint`
Providing an `inputType` attribute on a text field improves usability because depending on the data to be input, optimized keyboards can be shown to the user (such as just digits and parentheses for a phone number). Similarly,a hint attribute displays a hint to the user for what is expected in the text field.
The lint detector also looks at the `id` of the view, and if the id offers a hint of the purpose of the field (for example, the `id` contains the phrase `phone` or `email`), then lint will also ensure that the `inputType` contains the corresponding type attributes.
If you really want to keep the text field generic, you can suppress this warning by setting `inputType="text"`.
More info:
To suppress this error, use the issue id "TextFields" as explained in the Suppressing Warnings and Errors section.
TextViewEdits
Disabled By: Project lint.xml file
Priority: 7 / 10
Category: Correctness
Severity: Warning
Explanation: TextView should probably be an EditText instead.
Using a `<TextView>` to input text is generally an error, you should be using `<EditText>` instead. `EditText` is a subclass of `TextView`, and some of the editing support is provided by `TextView`, so it's possible to set some input-related properties on a `TextView`. However, using a `TextView` along with input attributes is usually a cut & paste error. To input text you should be using `<EditText>`.
This check also checks subclasses of `TextView`, such as `Button` and `CheckBox`, since these have the same issue: they should not be used with editable attributes.
More info:
To suppress this error, use the issue id "TextViewEdits" as explained in the Suppressing Warnings and Errors section.
TooDeepLayout
Disabled By: Project lint.xml file
Priority: 1 / 10
Category: Performance
Severity: Warning
Explanation: Layout hierarchy is too deep.
Layouts with too much nesting is bad for performance. Consider using a flatter layout (such as `RelativeLayout` or `GridLayout`).The default maximum depth is 10 but can be configured with the environment variable `ANDROID_LINT_MAX_DEPTH`.
More info:
To suppress this error, use the issue id "TooDeepLayout" as explained in the Suppressing Warnings and Errors section.
TooManyViews
Disabled By: Project lint.xml file
Priority: 1 / 10
Category: Performance
Severity: Warning
Explanation: Layout has too many views.
Using too many views in a single layout is bad for performance. Consider using compound drawables or other tricks for reducing the number of views in this layout.
The maximum view count defaults to 80 but can be configured with the environment variable `ANDROID_LINT_MAX_VIEW_COUNT`.
More info:
To suppress this error, use the issue id "TooManyViews" as explained in the Suppressing Warnings and Errors section.
TrulyRandom
Disabled By: Project lint.xml file
Priority: 9 / 10
Category: Security
Severity: Warning
Explanation: Weak RNG.
Key generation, signing, encryption, and random number generation may not receive cryptographically strong values due to improper initialization of the underlying PRNG on Android 4.3 and below.
If your application relies on cryptographically secure random number generation you should apply the workaround described in https://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html .
This lint rule is mostly informational; it does not accurately detect whether cryptographically secure RNG is required, or whether the workaround has already been applied. After reading the blog entry and updating your code if necessary, you can disable this lint issue.
More info: https://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html
To suppress this error, use the issue id "TrulyRandom" as explained in the Suppressing Warnings and Errors section.
TrustAllX509TrustManager
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Security
Severity: Warning
Explanation: Insecure TLS/SSL trust manager.
This check looks for X509TrustManager implementations whose `checkServerTrusted` or `checkClientTrusted` methods do nothing (thus trusting any certificate chain) which could result in insecure network traffic caused by trusting arbitrary TLS/SSL certificates presented by peers.
More info:
To suppress this error, use the issue id "TrustAllX509TrustManager" as explained in the Suppressing Warnings and Errors section.
TypographyDashes
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability:Typography
Severity: Warning
Explanation: Hyphen can be replaced with dash.
The "n dash" (–, &#8211;) and the "m dash" (—, &#8212;) characters are used for ranges (n dash) and breaks (m dash). Using these instead of plain hyphens can make text easier to read and your application will look more polished.
More info: http://en.wikipedia.org/wiki/Dash
To suppress this error, use the issue id "TypographyDashes" as explained in the Suppressing Warnings and Errors section.
TypographyEllipsis
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability:Typography
Severity: Warning
Explanation: Ellipsis string can be replaced with ellipsis character.
You can replace the string "..." with a dedicated ellipsis character, ellipsis character (…, &#8230;). This can help make the text more readable.
More info: http://en.wikipedia.org/wiki/Ellipsis
To suppress this error, use the issue id "TypographyEllipsis" as explained in the Suppressing Warnings and Errors section.
TypographyFractions
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Usability:Typography
Severity: Warning
Explanation: Fraction string can be replaced with fraction character.
You can replace certain strings, such as 1/2, and 1/4, with dedicated characters for these, such as ½ (&#189;) and ¼ (&#188;). This can help make the text more readable.
More info: http://en.wikipedia.org/wiki/Number_Forms
To suppress this error, use the issue id "TypographyFractions" as explained in the Suppressing Warnings and Errors section.
TypographyOther
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Usability:Typography
Severity: Warning
Explanation: Other typographical problems.
This check looks for miscellaneous typographical problems and offers replacement sequences that will make the text easier to read and your application more polished.
More info:
To suppress this error, use the issue id "TypographyOther" as explained in the Suppressing Warnings and Errors section.
TypographyQuotes
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Default
Priority: 5 / 10
Category: Usability:Typography
Severity: Warning
Explanation: Straight quotes can be replaced with curvy quotes.
Straight single quotes and double quotes, when used as a pair, can be replaced by "curvy quotes" (or directional quotes). This can make the text more readable.
Note that you should never use grave accents and apostrophes to quote, `like this'.
(Also note that you should not use curvy quotes for code fragments.)
More info: http://en.wikipedia.org/wiki/Quotation_mark
To suppress this error, use the issue id "TypographyQuotes" as explained in the Suppressing Warnings and Errors section.
Typos
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 7 / 10
Category: Correctness:Messages
Severity: Warning
Explanation: Spelling error.
This check looks through the string definitions, and if it finds any words that look like likely misspellings, they are flagged.
More info:
To suppress this error, use the issue id "Typos" as explained in the Suppressing Warnings and Errors section.
UniqueConstants
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Correctness
Severity: Error
Explanation: Overlapping Enumeration Constants.
The `@IntDef` annotation allows you to create a light-weight "enum" or type definition. However, it's possible to accidentally specify the same value for two or more of the values, which can lead to hard-to-detect bugs. This check looks for this scenario and flags any repeated constants.
In some cases, the repeated constant is intentional (for example, renaming a constant to a more intuitive name, and leaving the old name in place for compatibility purposes.) In that case, simply suppress this check by adding a `@SuppressLint("UniqueConstants")` annotation.
More info:
To suppress this error, use the issue id "UniqueConstants" as explained in the Suppressing Warnings and Errors section.
UnknownIdInLayout
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness
Severity: Warning
Explanation: Reference to an id that is not in the current layout.
The `@+id/` syntax refers to an existing id, or creates a new one if it has not already been defined elsewhere. However, this means that if you have a typo in your reference, or if the referred view no longer exists, you do not get a warning since the id will be created on demand.
This is sometimes intentional, for example where you are referring to a view which is provided in a different layout via an include. However, it is usually an accident where you have a typo or you have renamed a view without updating all the references to it.
More info:
To suppress this error, use the issue id "UnknownIdInLayout" as explained in the Suppressing Warnings and Errors section.
UnlocalizedSms
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness
Severity: Warning
Explanation: SMS phone number missing country code.
SMS destination numbers must start with a country code or the application code must ensure that the SMS is only sent when the user is in the same country as the receiver.
More info:
To suppress this error, use the issue id "UnlocalizedSms" as explained in the Suppressing Warnings and Errors section.
UnprotectedSMSBroadcastReceiver
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Security
Severity: Warning
Explanation: Unprotected SMS BroadcastReceiver.
BroadcastReceivers that declare an intent-filter for SMS_DELIVER or SMS_RECEIVED must ensure that the caller has the BROADCAST_SMS permission, otherwise it is possible for malicious actors to spoof intents.
More info:
To suppress this error, use the issue id "UnprotectedSMSBroadcastReceiver" as explained in the Suppressing Warnings and Errors section.
UnsafeProtectedBroadcastReceiver
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Security
Severity: Warning
Explanation: Unsafe Protected BroadcastReceiver.
BroadcastReceivers that declare an intent-filter for a protected-broadcast action string must check that the received intent's action string matches the expected value, otherwise it is possible for malicious actors to spoof intents.
More info:
To suppress this error, use the issue id "UnsafeProtectedBroadcastReceiver" as explained in the Suppressing Warnings and Errors section.
UnsupportedTvHardware
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Unsupported TV Hardware Feature.
The <uses-feature> element should not require this unsupported TV hardware feature. Any uses-feature not explicitly marked with required="false" is necessary on the device to be installed on. Ensure that any features that might prevent it from being installed on a TV device are reviewed and marked as not required in the manifest.
More info: https://developer.android.com/training/tv/start/hardware.html#unsupported-features
To suppress this error, use the issue id "UnsupportedTvHardware" as explained in the Suppressing Warnings and Errors section.
UnusedAttribute
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Attribute unused on older versions.
This check finds attributes set in XML files that were introduced in a version newer than the oldest version targeted by your application (with the `minSdkVersion` attribute).
This is not an error; the application will simply ignore the attribute. However, if the attribute is important to the appearance of functionality of your application, you should consider finding an alternative way to achieve the same result with only available attributes, and then you can optionally create a copy of the layout in a layout-vNN folder which will be used on API NN or higher where you can take advantage of the newer attribute.
Note: This check does not only apply to attributes. For example, some tags can be unused too, such as the new `<tag>` element in layouts introduced in API 21.
More info:
To suppress this error, use the issue id "UnusedAttribute" as explained in the Suppressing Warnings and Errors section.
UnusedIds
Disabled By: Default
Priority: 1 / 10
Category: Performance
Severity: Warning
Explanation: Unused id.
This resource id definition appears not to be needed since it is not referenced from anywhere. Having id definitions, even if unused, is not necessarily a bad idea since they make working on layouts and menus easier, so there is not a strong reason to delete these.
More info:
To suppress this error, use the issue id "UnusedIds" as explained in the Suppressing Warnings and Errors section.
UnusedNamespace
Disabled By: Project lint.xml file
Priority: 1 / 10
Category: Performance
Severity: Warning
Explanation: Unused namespace.
Unused namespace declarations take up space and require processing that is not necessary
More info:
To suppress this error, use the issue id "UnusedNamespace" as explained in the Suppressing Warnings and Errors section.
UnusedQuantity
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Correctness:Messages
Severity: Warning
Explanation: Unused quantity translations.
Android defines a number of different quantity strings, such as `zero`, `one`, `few` and `many`. However, many languages do not distinguish grammatically between all these different quantities.
This lint check looks at the quantity strings defined for each translation and flags any quantity strings that are unused (because the language does not make that quantity distinction, and Android will therefore not look it up.).
For example, in Chinese, only the `other` quantity is used, so even if you provide translations for `zero` and `one`, these strings will not be returned when `getQuantityString()` is called, even with `0` or `1`.
More info: http://developer.android.com/guide/topics/resources/string-resource.html#Plurals
To suppress this error, use the issue id "UnusedQuantity" as explained in the Suppressing Warnings and Errors section.
UnusedResources
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Performance
Severity: Warning
Explanation: Unused resources.
Unused resources make applications larger and slow down builds.
More info:
To suppress this error, use the issue id "UnusedResources" as explained in the Suppressing Warnings and Errors section.
UseAlpha2
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Using 3-letter Codes.
For compatibility with earlier devices, you should only use 3-letter language and region codes when there is no corresponding 2 letter code.
More info: https://tools.ietf.org/html/bcp47
To suppress this error, use the issue id "UseAlpha2" as explained in the Suppressing Warnings and Errors section.
UseCheckPermission
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Security
Severity: Warning
Explanation: Using the result of check permission calls.
You normally want to use the result of checking a permission; these methods return whether the permission is held; they do not throw an error if the permission is not granted. Code which does not do anything with the return value probably meant to be calling the enforce methods instead, e.g. rather than `Context#checkCallingPermission` it should call `Context#enforceCallingPermission`.
More info:
To suppress this error, use the issue id "UseCheckPermission" as explained in the Suppressing Warnings and Errors section.
UseCompoundDrawables
Note: This issue has an associated quickfix operation in Eclipse/ADT
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Performance
Severity: Warning
Explanation: Node can be replaced by a `TextView` with compound drawables.
A `LinearLayout` which contains an `ImageView` and a `TextView` can be more efficiently handled as a compound drawable (a single TextView, using the `drawableTop`, `drawableLeft`, `drawableRight` and/or `drawableBottom` attributes to draw one or more images adjacent to the text).
If the two widgets are offset from each other with margins, this can be replaced with a `drawablePadding` attribute.
There's a lint quickfix to perform this conversion in the Eclipse plugin.
More info:
To suppress this error, use the issue id "UseCompoundDrawables" as explained in the Suppressing Warnings and Errors section.
UseSparseArrays
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Performance
Severity: Warning
Explanation: HashMap can be replaced with SparseArray.
For maps where the keys are of type integer, it's typically more efficient to use the Android `SparseArray` API. This check identifies scenarios where you might want to consider using `SparseArray` instead of `HashMap` for better performance.
This is particularly useful when the value types are primitives like ints, where you can use `SparseIntArray` and avoid auto-boxing the values from `int` to `Integer`.
If you need to construct a `HashMap` because you need to call an API outside of your control which requires a `Map`, you can suppress this warning using for example the `@SuppressLint` annotation.
More info:
To suppress this error, use the issue id "UseSparseArrays" as explained in the Suppressing Warnings and Errors section.
UseValueOf
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Performance
Severity: Warning
Explanation: Should use `valueOf` instead of `new`
You should not call the constructor for wrapper classes directly, such as`new Integer(42)`. Instead, call the `valueOf` factory method, such as `Integer.valueOf(42)`. This will typically use less memory because common integers such as 0 and 1 will share a single instance.
More info:
To suppress this error, use the issue id "UseValueOf" as explained in the Suppressing Warnings and Errors section.
UselessLeaf
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 2 / 10
Category: Performance
Severity: Warning
Explanation: Useless leaf layout.
A layout that has no children or no background can often be removed (since it is invisible) for a flatter and more efficient layout hierarchy.
More info:
To suppress this error, use the issue id "UselessLeaf" as explained in the Suppressing Warnings and Errors section.
UselessParent
Note: This issue has an associated quickfix operation in Eclipse/ADT
Disabled By: Project lint.xml file
Priority: 2 / 10
Category: Performance
Severity: Warning
Explanation: Useless parent layout.
A layout with children that has no siblings, is not a scrollview or a root layout, and does not have a background, can be removed and have its children moved directly into the parent for a flatter and more efficient layout hierarchy.
More info:
To suppress this error, use the issue id "UselessParent" as explained in the Suppressing Warnings and Errors section.
UsesMinSdkAttributes
Disabled By: Project lint.xml file
Priority: 9 / 10
Category: Correctness
Severity: Warning
Explanation: Minimum SDK and target SDK attributes not defined.
The manifest should contain a `<uses-sdk>` element which defines the minimum API Level required for the application to run, as well as the target version (the highest API level you have tested the version for.)
More info: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
To suppress this error, use the issue id "UsesMinSdkAttributes" as explained in the Suppressing Warnings and Errors section.
UsingHttp
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Security
Severity: Warning
Explanation: Using HTTP instead of HTTPS.
The Gradle Wrapper is available both via HTTP and HTTPS. HTTPS is more secure since it protects against man-in-the-middle attacks etc. Older projects created in Android Studio used HTTP but we now default to HTTPS and recommend upgrading existing projects.
More info:
To suppress this error, use the issue id "UsingHttp" as explained in the Suppressing Warnings and Errors section.
VectorRaster
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Correctness
Severity: Warning
Explanation: Vector Image Generation.
Vector icons require API 21, but when using Android Gradle plugin 1.4 or higher, vectors placed in the `drawable` folder are automatically moved to `drawable-*dpi-v21` and a bitmap image is generated each `drawable-*dpi` folder instead, for backwards compatibility (provided `minSdkVersion` is less than 21.).
However, there are some limitations to this vector image generation, and this lint check flags elements and attributes that are not fully supported. You should manually check whether the generated output is acceptable for those older devices.
More info:
To suppress this error, use the issue id "VectorRaster" as explained in the Suppressing Warnings and Errors section.
ViewConstructor
Disabled By: Project lint.xml file
Priority: 3 / 10
Category: Usability
Severity: Warning
Explanation: Missing View constructors for XML inflation.
Some layout tools (such as the Android layout editor for Studio & Eclipse) needs to find a constructor with one of the following signatures:
* `View(Context context)`
* `View(Context context, AttributeSet attrs)`
* `View(Context context, AttributeSet attrs, int defStyle)`
If your custom view needs to perform initialization which does not apply when used in a layout editor, you can surround the given code with a check to see if `View#isInEditMode()` is false, since that method will return `false` at runtime but true within a user interface editor.
More info:
To suppress this error, use the issue id "ViewConstructor" as explained in the Suppressing Warnings and Errors section.
ViewHolder
Disabled By: Project lint.xml file
Priority: 5 / 10
Category: Performance
Severity: Warning
Explanation: View Holder Candidates.
When implementing a view Adapter, you should avoid unconditionally inflating a new layout; if an available item is passed in for reuse, you should try to use that one instead. This helps make for example ListView scrolling much smoother.
More info: http://developer.android.com/training/improving-layouts/smooth-scrolling.html#ViewHolder
To suppress this error, use the issue id "ViewHolder" as explained in the Suppressing Warnings and Errors section.
ViewTag
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Performance
Severity: Warning
Explanation: Tagged object leaks.
Prior to Android 4.0, the implementation of `View.setTag(int, Object)` would store the objects in a static map, where the values were strongly referenced. This means that if the object contains any references pointing back to the context, the context (which points to pretty much everything else) will leak. If you pass a view, the view provides a reference to the context that created it. Similarly, view holders typically contain a view, and cursors are sometimes also associated with views.
More info:
To suppress this error, use the issue id "ViewTag" as explained in the Suppressing Warnings and Errors section.
Wakelock
Disabled By: Project lint.xml file
Priority: 9 / 10
Category: Performance
Severity: Warning
Explanation: Incorrect `WakeLock` usage.
Failing to release a wakelock properly can keep the Android device in a high power mode, which reduces battery life. There are several causes of this, such as releasing the wake lock in `onDestroy()` instead of in `onPause()`, failing to call `release()` in all possible code paths after an `acquire()`, and so on.
NOTE: If you are using the lock just to keep the screen on, you should strongly consider using `FLAG_KEEP_SCREEN_ON` instead. This window flag will be correctly managed by the platform as the user moves between applications and doesn't require a special permission. See http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_KEEP_SCREEN_ON.
More info:
To suppress this error, use the issue id "Wakelock" as explained in the Suppressing Warnings and Errors section.
WebViewLayout
Disabled By: Project lint.xml file
Priority: 7 / 10
Category: Correctness
Severity: Error
Explanation: WebViews in wrap_content parents.
The WebView implementation has certain performance optimizations which will not work correctly if the parent view is using `wrap_content` rather than `match_parent`. This can lead to subtle UI bugs.
More info:
To suppress this error, use the issue id "WebViewLayout" as explained in the Suppressing Warnings and Errors section.
WorldReadableFiles
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Security
Severity: Warning
Explanation: `openFileOutput()` or similar call passing `MODE_WORLD_READABLE`
There are cases where it is appropriate for an application to write world readable files, but these should be reviewed carefully to ensure that they contain no private data that is leaked to other applications.
More info:
To suppress this error, use the issue id "WorldReadableFiles" as explained in the Suppressing Warnings and Errors section.
WorldWriteableFiles
Disabled By: Project lint.xml file
Priority: 4 / 10
Category: Security
Severity: Warning
Explanation: `openFileOutput()` or similar call passing `MODE_WORLD_WRITEABLE`
There are cases where it is appropriate for an application to write world writeable files, but these should be reviewed carefully to ensure that they contain no private data, and that if the file is modified by a malicious application it does not trick or compromise your application.
More info:
To suppress this error, use the issue id "WorldWriteableFiles" as explained in the Suppressing Warnings and Errors section.
WrongConstant
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Security
Severity: Error
Explanation: Incorrect constant.
Ensures that when parameter in a method only allows a specific set of constants, calls obey those rules.
More info:
To suppress this error, use the issue id "WrongConstant" as explained in the Suppressing Warnings and Errors section.
WrongRegion
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Suspicious Language/Region Combination.
Android uses the letter codes ISO 639-1 for languages, and the letter codes ISO 3166-1 for the region codes. In many cases, the language code and the country where the language is spoken is the same, but it is also often not the case. For example, while 'se' refers to Sweden, where Swedish is spoken, the language code for Swedish is not `se` (which refers to the Northern Sami language), the language code is `sv`. And similarly the region code for `sv` is El Salvador.
This lint check looks for suspicious language and region combinations, to help catch cases where you've accidentally used the wrong language or region code. Lint knows about the most common regions where a language is spoken, and if a folder combination is not one of these, it is flagged as suspicious.
Note however that it may not be an error: you can theoretically have speakers of any language in any region and want to target that with your resources, so this check is aimed at tracking down likely mistakes, not to enforce a specific set of region and language combinations.
More info:
To suppress this error, use the issue id "WrongRegion" as explained in the Suppressing Warnings and Errors section.
WrongThread
Disabled By: Project lint.xml file
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Wrong Thread.
Ensures that a method which expects to be called on a specific thread, is actually called from that thread. For example, calls on methods in widgets should always be made on the UI thread.
More info: http://developer.android.com/guide/components/processes-and-threads.html#Threads
To suppress this error, use the issue id "WrongThread" as explained in the Suppressing Warnings and Errors section.
Suppressing Warnings and Errors
Lint errors can be suppressed in a variety of ways:
1. With a `@SuppressLint` annotation in the Java code
2. With a `tools:ignore` attribute in the XML file
3. With ignore flags specified in the `build.gradle` file, as explained below
4. With a `lint.xml` configuration file in the project
5. With a `lint.xml` configuration file passed to lint via the --config flag
6. 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 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 project in which it applies.
The format of the `lint.xml` file is something like the following:
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- 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" />
</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/path`
For more information, see http://g.co/androidstudio/suppressing-lint-warnings