+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+
+
+
+
+ Correctness + | |
2 | error +MissingSuperCall: Missing Super Call |
3 | error +MissingInflatedId: ID not found in inflated resource |
2 | error +ProtectedPermissions: Using system app permission |
12 | error +RestrictedApi: Restricted API |
Correctness:Messages + | |
11 | error +TimberArgCount: Formatting argument types incomplete or inconsistent |
Included Additional Checks (48) + | |
Disabled Checks (312) + |
+
+
+
+
+
+ Missing Super Call
+
+
+
+
+
+
+../../src/main/java/com/breadwallet/presenter/activities/DisabledActivity.java:119: Overriding method should call
+super.onBackPressed
+ 116 } + 117 + 118 @Override + 119 public void onBackPressed() { + 120 if (getFragmentManager().getBackStackEntryCount() > 0) { + 121 getFragmentManager().popBackStack(); + 122 } else if (AuthManager.getInstance().isWalletDisabled(DisabledActivity.this)) { ++ +../../src/main/java/com/breadwallet/presenter/activities/camera/ScanQRActivity.java:122: Overriding method should call
super.onRequestPermissionsResult
+ 119 } + 120 + 121 @Override + 122 public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, + 123 @NonNull int[] grantResults) { + 124 if (requestCode != MY_PERMISSION_REQUEST_CAMERA) { + 125 return; ++ +
+Some methods, such as
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+To suppress this error, use the issue id "MissingSuperCall" as explained in the Suppressing Warnings and Errors section.
+
+View#onDetachedFromWindow
, require that you also call the super implementation as part of your method.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+To suppress this error, use the issue id "MissingSuperCall" as explained in the Suppressing Warnings and Errors section.
+
+
+ MissingSuperCall
+
+
+ Correctness
+
+
+ Error
+
+
+ Priority 9/10
+
+
+
+
+
+
+
+
+ ID not found in inflated resource
+
+
+
+
+
+
+../../src/main/java/com/breadwallet/presenter/activities/settings/DisplayCurrencyActivity.java:62:
+@layout/activity_display_currency
does not contain a declaration with id faq_button
+ 59 + 60 //TODO: all views are using the layout of this button. Views should be refactored without it + 61 // Hiding until layouts are built. + 62 ImageButton faq = findViewById(R.id.faq_button); + 63 + 64 exchangeText = findViewById(R.id.exchange_text); + 65 listView = findViewById(R.id.currency_list_view); ++ +../../src/main/java/com/breadwallet/presenter/fragments/FragmentTransactionDetails.java:39:
@layout/fragment_transaction_details
does not contain a declaration with id title
+ 36 // The last two arguments ensure LayoutParams are inflated + 37 // properly. + 38 View rootView = inflater.inflate(R.layout.fragment_transaction_details, container, false); + 39 mTitle = (TextView) rootView.findViewById(R.id.title); + 40 backgroundLayout = (LinearLayout) rootView.findViewById(R.id.background_layout); + 41 txViewPager = (ViewPager) rootView.findViewById(R.id.tx_list_pager); + 42 txViewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { ++ +../../src/main/java/com/breadwallet/presenter/activities/settings/SyncBlockchainActivity.java:143:
@layout/activity_sync_blockchain
does not contain a declaration with id close_button
+ 140 } + 141 }); + 142 + 143 closeButton = (ImageButton) findViewById(R.id.close_button); + 144 closeButton.setOnClickListener(new View.OnClickListener() { + 145 @Override + 146 public void onClick(View v) { ++ +
+Checks calls to layout inflation and makes sure that the referenced ids are found in the corresponding layout (or at least one of them, if the layout has multiple configurations.)
To suppress this error, use the issue id "MissingInflatedId" as explained in the Suppressing Warnings and Errors section.
+
+To suppress this error, use the issue id "MissingInflatedId" as explained in the Suppressing Warnings and Errors section.
+
+
+ MissingInflatedId
+
+
+ Correctness
+
+
+ Error
+
+
+ Priority 5/10
+
+
+
+
+
+
+
+
+ Using system app permission
+
+
+
+
+
+
+../../src/main/AndroidManifest.xml:21: Permission is only granted to system apps
++ 18 <uses-permission android:name="android.permission.USE_BIOMETRIC" /> + 19 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> + 20 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> + 21 <uses-permission android:name="android.permission.BIND_JOB_SERVICE" /> + 22 <uses-permission android:name="com.google.android.gms.permission.AD_ID" /> <!-- Allows unlocking your device and activating its screen so UI tests can succeed --> + 23 <uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> <!-- Allows changing locales --> + 24 <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" /> ++ +../../src/main/AndroidManifest.xml:24: Permission is only granted to system apps
+ 21 <uses-permission android:name="android.permission.BIND_JOB_SERVICE" /> + 22 <uses-permission android:name="com.google.android.gms.permission.AD_ID" /> <!-- Allows unlocking your device and activating its screen so UI tests can succeed --> + 23 <uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> <!-- Allows changing locales --> + 24 <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" /> + 25 + 26 <uses-feature + 27 android:name="android.hardware.location.gps"+ +
+Permissions with the protection level
To suppress this error, use the issue id "ProtectedPermissions" as explained in the Suppressing Warnings and Errors section.
+
+signature
, privileged
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.To suppress this error, use the issue id "ProtectedPermissions" as explained in the Suppressing Warnings and Errors section.
+
+
+ ProtectedPermissions
+
+
+ Correctness
+
+
+ Error
+
+
+ Priority 5/10
+
+
+
+
+
+
+
+
+ Restricted API
+
+
+
+
+
+
+../generated/data_binding_base_class_source_out/litewalletDebug/out/com/breadwallet/databinding/ChangeLanguageBottomSheetBinding.java:53: ViewDataBinding.inflateInternal can only be called from within the same library group (referenced groupId=
+androidx.databinding
from groupId=litewallet-android
)+ 50 @Deprecated + 51 public static ChangeLanguageBottomSheetBinding inflate(@NonNull LayoutInflater inflater, + 52 @Nullable ViewGroup root, boolean attachToRoot, @Nullable Object component) { + 53 return ViewDataBinding.<ChangeLanguageBottomSheetBinding>inflateInternal(inflater, R.layout.change_language_bottom_sheet, root, attachToRoot, component); + 54 } + 55 + 56 @NonNull+ +../generated/data_binding_base_class_source_out/litewalletDebug/out/com/breadwallet/databinding/ChangeLanguageBottomSheetBinding.java:72: ViewDataBinding.inflateInternal can only be called from within the same library group (referenced groupId=
androidx.databinding
from groupId=litewallet-android
)+ 69 @Deprecated + 70 public static ChangeLanguageBottomSheetBinding inflate(@NonNull LayoutInflater inflater, + 71 @Nullable Object component) { + 72 return ViewDataBinding.<ChangeLanguageBottomSheetBinding>inflateInternal(inflater, R.layout.change_language_bottom_sheet, null, false, component); + 73 } + 74 + 75 public static ChangeLanguageBottomSheetBinding bind(@NonNull View view) { ++ +../generated/source/kapt/litewalletDebug/androidx/databinding/DataBinderMapperImpl.java:3: MergedDataBinderMapper can only be accessed from within the same library (androidx.databinding:databinding-runtime)
+ 1 package androidx.databinding; + 2 + 3 public class DataBinderMapperImpl extends MergedDataBinderMapper { + 4 DataBinderMapperImpl() { + 5 addMapper(new com.breadwallet.DataBinderMapperImpl()); + 6 } ++ +../generated/source/kapt/litewalletDebug/androidx/databinding/DataBinderMapperImpl.java:5: MergedDataBinderMapper.addMapper can only be called from within the same library (androidx.databinding:databinding-runtime)
+ 2 + 3 public class DataBinderMapperImpl extends MergedDataBinderMapper { + 4 DataBinderMapperImpl() { + 5 addMapper(new com.breadwallet.DataBinderMapperImpl()); + 6 } + 7 } ++ +../generated/source/kapt/litewalletDebug/com/breadwallet/DataBinderMapperImpl.java:21: DataBinderMapper can only be accessed from within the same library (androidx.databinding:databinding-runtime)
+ 18 import java.util.HashMap; + 19 import java.util.List; + 20 + 21 public class DataBinderMapperImpl extends DataBinderMapper { + 22 private static final int LAYOUT_CHANGELANGUAGEBOTTOMSHEET = 1; + 23 + 24 private static final int LAYOUT_FRAGMENTHISTORY = 2; ++ ++ 7 More Occurrences... +
+../generated/source/kapt/litewalletDebug/com/breadwallet/DataBinderMapperImpl.java:34: DataBinderMapper.getDataBinder can only be called from within the same library (androidx.databinding:databinding-runtime)
++ 31 } + 32 + 33 @Override + 34 public ViewDataBinding getDataBinder(DataBindingComponent component, View view, int layoutId) { + 35 int localizedLayoutId = INTERNAL_LAYOUT_ID_LOOKUP.get(layoutId); + 36 if(localizedLayoutId > 0) { + 37 final Object tag = view.getTag(); ++ +../generated/source/kapt/litewalletDebug/com/breadwallet/DataBinderMapperImpl.java:60: DataBinderMapper.getDataBinder can only be called from within the same library (androidx.databinding:databinding-runtime)
+ 57 } + 58 + 59 @Override + 60 public ViewDataBinding getDataBinder(DataBindingComponent component, View[] views, int layoutId) { + 61 if(views == null || views.length == 0) { + 62 return null; + 63 } ++ +../generated/source/kapt/litewalletDebug/com/breadwallet/DataBinderMapperImpl.java:77: DataBinderMapper.getLayoutId can only be called from within the same library (androidx.databinding:databinding-runtime)
+ 74 } + 75 + 76 @Override + 77 public int getLayoutId(String tag) { + 78 if (tag == null) { + 79 return 0; + 80 } ++ +../generated/source/kapt/litewalletDebug/com/breadwallet/DataBinderMapperImpl.java:86: DataBinderMapper.convertBrIdToString can only be called from within the same library (androidx.databinding:databinding-runtime)
+ 83 } + 84 + 85 @Override + 86 public String convertBrIdToString(int localId) { + 87 String tmpVal = InnerBrLookup.sKeys.get(localId); + 88 return tmpVal; + 89 } ++ +../generated/source/kapt/litewalletDebug/com/breadwallet/DataBinderMapperImpl.java:92: DataBinderMapper.collectDependencies can only be called from within the same library (androidx.databinding:databinding-runtime)
+ 89 } + 90 + 91 @Override + 92 public List<DataBinderMapper> collectDependencies() { + 93 ArrayList<DataBinderMapper> result = new ArrayList<DataBinderMapper>(1); + 94 result.add(new androidx.databinding.library.baseAdapters.DataBinderMapperImpl()); + 95 return result; ++ +../generated/data_binding_base_class_source_out/litewalletDebug/out/com/breadwallet/databinding/FragmentHistoryBinding.java:48: ViewDataBinding.inflateInternal can only be called from within the same library group (referenced groupId=
androidx.databinding
from groupId=litewallet-android
)+ 45 @Deprecated + 46 public static FragmentHistoryBinding inflate(@NonNull LayoutInflater inflater, + 47 @Nullable ViewGroup root, boolean attachToRoot, @Nullable Object component) { + 48 return ViewDataBinding.<FragmentHistoryBinding>inflateInternal(inflater, R.layout.fragment_history, root, attachToRoot, component); + 49 } + 50 + 51 @NonNull+ +../generated/data_binding_base_class_source_out/litewalletDebug/out/com/breadwallet/databinding/FragmentHistoryBinding.java:67: ViewDataBinding.inflateInternal can only be called from within the same library group (referenced groupId=
androidx.databinding
from groupId=litewallet-android
)+ 64 @Deprecated + 65 public static FragmentHistoryBinding inflate(@NonNull LayoutInflater inflater, + 66 @Nullable Object component) { + 67 return ViewDataBinding.<FragmentHistoryBinding>inflateInternal(inflater, R.layout.fragment_history, null, false, component); + 68 } + 69 + 70 public static FragmentHistoryBinding bind(@NonNull View view) { ++ +
+This API has been flagged with a restriction that has not been met.
+
+Examples of API restrictions:
+* Method can only be invoked by a subclass
+* Method can only be accessed from within the same library (defined by the Gradle library group id)
+* Method can only be accessed from tests.
+
+You can add your own API restrictions with the
To suppress this error, use the issue id "RestrictedApi" as explained in the Suppressing Warnings and Errors section.
+
++
+Examples of API restrictions:
+* Method can only be invoked by a subclass
+* Method can only be accessed from within the same library (defined by the Gradle library group id)
+* Method can only be accessed from tests.
+
+You can add your own API restrictions with the
@RestrictTo
annotation.To suppress this error, use the issue id "RestrictedApi" as explained in the Suppressing Warnings and Errors section.
+
+
+ RestrictedApi
+
+
+ Correctness
+
+
+ Error
+
+
+ Priority 4/10
+
+
+
+
+
+
+
+
+ Formatting argument types incomplete or inconsistent
+
+
+
+
+
+
+../../src/main/java/com/breadwallet/wallet/BRWalletManager.java:379: Wrong argument count, format string
+timber: onTxAdded: tx.length: %d, blockHeight: %d, timestamp: %d, amount: %d, hash: %s
requires 5
but format call supplies 0
+ 376 } + 377 + 378 public static void onTxAdded(byte[] tx, int blockHeight, long timestamp, final long amount, String hash) { + 379 Timber.d("timber: onTxAdded: " + String.format("tx.length: %d, blockHeight: %d, timestamp: %d, amount: %d, hash: %s", tx.length, blockHeight, timestamp, amount, hash)); + 380 + 381 final Context ctx = BreadApp.getBreadContext(); + 382 if (amount > 0) { ++ +../../src/main/java/com/breadwallet/wallet/BRWalletManager.java:379: Wrong argument count, format string
timber: onTxAdded: tx.length: %d, blockHeight: %d, timestamp: %d, amount: %d, hash: %s
requires 5
but format call supplies 0
+ 376 } + 377 + 378 public static void onTxAdded(byte[] tx, int blockHeight, long timestamp, final long amount, String hash) { + 379 Timber.d("timber: onTxAdded: " + String.format("tx.length: %d, blockHeight: %d, timestamp: %d, amount: %d, hash: %s", tx.length, blockHeight, timestamp, amount, hash)); + 380 + 381 final Context ctx = BreadApp.getBreadContext(); + 382 if (amount > 0) { ++ +../../src/main/java/com/breadwallet/wallet/BRWalletManager.java:379: Wrong argument count, format string
timber: onTxAdded: tx.length: %d, blockHeight: %d, timestamp: %d, amount: %d, hash: %s
requires 5
but format call supplies 0
+ 376 } + 377 + 378 public static void onTxAdded(byte[] tx, int blockHeight, long timestamp, final long amount, String hash) { + 379 Timber.d("timber: onTxAdded: " + String.format("tx.length: %d, blockHeight: %d, timestamp: %d, amount: %d, hash: %s", tx.length, blockHeight, timestamp, amount, hash)); + 380 + 381 final Context ctx = BreadApp.getBreadContext(); + 382 if (amount > 0) { ++ +../../src/main/java/com/breadwallet/wallet/BRWalletManager.java:379: Wrong argument count, format string
timber: onTxAdded: tx.length: %d, blockHeight: %d, timestamp: %d, amount: %d, hash: %s
requires 5
but format call supplies 0
+ 376 } + 377 + 378 public static void onTxAdded(byte[] tx, int blockHeight, long timestamp, final long amount, String hash) { + 379 Timber.d("timber: onTxAdded: " + String.format("tx.length: %d, blockHeight: %d, timestamp: %d, amount: %d, hash: %s", tx.length, blockHeight, timestamp, amount, hash)); + 380 + 381 final Context ctx = BreadApp.getBreadContext(); + 382 if (amount > 0) { ++ +../../src/main/java/com/breadwallet/wallet/BRWalletManager.java:379: Wrong argument count, format string
timber: onTxAdded: tx.length: %d, blockHeight: %d, timestamp: %d, amount: %d, hash: %s
requires 5
but format call supplies 0
+ 376 } + 377 + 378 public static void onTxAdded(byte[] tx, int blockHeight, long timestamp, final long amount, String hash) { + 379 Timber.d("timber: onTxAdded: " + String.format("tx.length: %d, blockHeight: %d, timestamp: %d, amount: %d, hash: %s", tx.length, blockHeight, timestamp, amount, hash)); + 380 + 381 final Context ctx = BreadApp.getBreadContext(); + 382 if (amount > 0) { ++ ++ 6 More Occurrences... +
+../../src/main/java/com/breadwallet/wallet/BRWalletManager.java:433: Wrong argument count, format string
+timber: onTxUpdated: hash: %s, blockHeight: %d, timestamp: %d
requires 3
but format call supplies 0
+ 430 } + 431 + 432 public static void onTxUpdated(String hash, int blockHeight, int timeStamp) { + 433 Timber.d("timber: onTxUpdated: " + String.format("hash: %s, blockHeight: %d, timestamp: %d", hash, blockHeight, timeStamp)); + 434 Context ctx = BreadApp.getBreadContext(); + 435 if (ctx != null) { + 436 TransactionDataSource.getInstance(ctx).updateTxBlockHeight(hash, blockHeight, timeStamp); ++ +../../src/main/java/com/breadwallet/wallet/BRWalletManager.java:433: Wrong argument count, format string
timber: onTxUpdated: hash: %s, blockHeight: %d, timestamp: %d
requires 3
but format call supplies 0
+ 430 } + 431 + 432 public static void onTxUpdated(String hash, int blockHeight, int timeStamp) { + 433 Timber.d("timber: onTxUpdated: " + String.format("hash: %s, blockHeight: %d, timestamp: %d", hash, blockHeight, timeStamp)); + 434 Context ctx = BreadApp.getBreadContext(); + 435 if (ctx != null) { + 436 TransactionDataSource.getInstance(ctx).updateTxBlockHeight(hash, blockHeight, timeStamp); ++ +../../src/main/java/com/breadwallet/wallet/BRWalletManager.java:433: Wrong argument count, format string
timber: onTxUpdated: hash: %s, blockHeight: %d, timestamp: %d
requires 3
but format call supplies 0
+ 430 } + 431 + 432 public static void onTxUpdated(String hash, int blockHeight, int timeStamp) { + 433 Timber.d("timber: onTxUpdated: " + String.format("hash: %s, blockHeight: %d, timestamp: %d", hash, blockHeight, timeStamp)); + 434 Context ctx = BreadApp.getBreadContext(); + 435 if (ctx != null) { + 436 TransactionDataSource.getInstance(ctx).updateTxBlockHeight(hash, blockHeight, timeStamp); ++ +../../src/main/java/com/breadwallet/wallet/BRWalletManager.java:444: Wrong argument count, format string
timber: onTxDeleted: hash: %s, notifyUser: %d, recommendRescan: %d
requires 3
but format call supplies 0
+ 441 } + 442 + 443 public static void onTxDeleted(String hash, int notifyUser, final int recommendRescan) { + 444 Timber.d("timber: onTxDeleted: " + String.format("hash: %s, notifyUser: %d, recommendRescan: %d", hash, notifyUser, recommendRescan)); + 445 final Context ctx = BreadApp.getBreadContext(); + 446 if (ctx != null) { + 447 BRSharedPrefs.putScanRecommended(ctx, true); ++ +../../src/main/java/com/breadwallet/wallet/BRWalletManager.java:444: Wrong argument count, format string
timber: onTxDeleted: hash: %s, notifyUser: %d, recommendRescan: %d
requires 3
but format call supplies 0
+ 441 } + 442 + 443 public static void onTxDeleted(String hash, int notifyUser, final int recommendRescan) { + 444 Timber.d("timber: onTxDeleted: " + String.format("hash: %s, notifyUser: %d, recommendRescan: %d", hash, notifyUser, recommendRescan)); + 445 final Context ctx = BreadApp.getBreadContext(); + 446 if (ctx != null) { + 447 BRSharedPrefs.putScanRecommended(ctx, true); ++ +../../src/main/java/com/breadwallet/wallet/BRWalletManager.java:444: Wrong argument count, format string
timber: onTxDeleted: hash: %s, notifyUser: %d, recommendRescan: %d
requires 3
but format call supplies 0
+ 441 } + 442 + 443 public static void onTxDeleted(String hash, int notifyUser, final int recommendRescan) { + 444 Timber.d("timber: onTxDeleted: " + String.format("hash: %s, notifyUser: %d, recommendRescan: %d", hash, notifyUser, recommendRescan)); + 445 final Context ctx = BreadApp.getBreadContext(); + 446 if (ctx != null) { + 447 BRSharedPrefs.putScanRecommended(ctx, true); ++ +
+When a formatted string takes arguments, you need to pass at least that amount of arguments to the formatting call.
To suppress this error, use the issue id "TimberArgCount" as explained in the Suppressing Warnings and Errors section.
+
+To suppress this error, use the issue id "TimberArgCount" as explained in the Suppressing Warnings and Errors section.
+
+Identifier: jetified-timber-4.7.1
+
++
+
+ TimberArgCount
+
+
+ Messages
+
+
+ Correctness
+
+
+ Error
+
+
+ Priority 9/10
+
+
+
+
+
+
+
+
+ Included Additional Checks
+
+This card lists all the extra checks run by lint, provided from libraries,
+build configuration and extra flags. This is included to help you verify
+whether a particular check is included in analysis when configuring builds.
+(Note that the list does not include the hundreds of built-in checks into lint,
+only additional ones.)
+
+
+
+
+
+BadConfigurationProvider
+
+
+An
+for on-demand initialization.
+
+android.app.Application
must implement androidx.work.Configuration.Provider
+for on-demand initialization.
+Vendor: Android Open Source Project (work-runtime-2.7.0)
+Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
++Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
+
+
+
+BadPeriodicWorkRequestEnqueue
+
+
+When using
+duplicate requests unintentionally. You should be using
+
+
+enqueue()
for `PeriodicWorkRequest`s, you might end up enqueuing+duplicate requests unintentionally. You should be using
+
enqueueUniquePeriodicWork
with an ExistingPeriodicWorkPolicy.KEEP
instead.
+Vendor: Android Open Source Project (work-runtime-2.7.0)
+Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
++Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
+
+
+
+BinaryOperationInTimber
+
+
+Since Timber handles String#format() automatically, use this instead of String concatenation.
+
+
+Identifier: jetified-timber-4.7.1
+
++
+
+
+
+DeepLinkInActivityDestination
+
+
+Attaching a <deeplink> to an <activity> destination will never give the right behavior when using an implicit deep link on another app's task (where the system back should immediately take the user back to the app that triggered the deep link). Instead, attach the deep link directly to the second activity (either by manually writing the appropriate <intent-filter> or by adding the <deeplink> to the start destination of a nav host in that second activity).
+
+
+Vendor: Android Open Source Project
+Identifier: androidx.navigation.runtime
+Feedback: https://issuetracker.google.com/issues/new?component=409828
+
++Identifier: androidx.navigation.runtime
+Feedback: https://issuetracker.google.com/issues/new?component=409828
+
+
+
+
+DetachAndAttachSameFragment
+
+
+When doing a FragmentTransaction that includes both attach() and detach() operations being committed on the same fragment instance, it is a no-op. The reason for this is that the FragmentManager optimizes all operations within a single transaction so the attach() and detach() cancel each other out and neither is actually executed. To get the desired behavior, you should separate the attach() and detach() calls into separate FragmentTransactions.
+
+
+Vendor: Android Open Source Project
+Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
++Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
+
+
+
+DialogFragmentCallbacksDetector
+
+
+When using a
+
+DialogFragment
, the setOnCancelListener
and setOnDismissListener
callback functions within the onCreateDialog
function __must not be used__ because the DialogFragment
owns these callbacks. Instead the respective onCancel
and onDismiss
functions can be used to achieve the desired effect.
+Vendor: Android Open Source Project
+Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
++Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
+
+
+
+EmptyNavDeepLink
+
+
+Attempting to create an empty NavDeepLink will result in an IllegalStateException at runtime. You may set these arguments within the lambda of the call to navDeepLink.
+
+
+Vendor: Android Open Source Project
+Identifier: androidx.navigation.common
+Feedback: https://issuetracker.google.com/issues/new?component=409828
+
++Identifier: androidx.navigation.common
+Feedback: https://issuetracker.google.com/issues/new?component=409828
+
+
+
+
+EnsureInitializerMetadata
+
+
+When a library defines a Initializer, it needs to be accompanied by a corresponding <meta-data> entry in the AndroidManifest.xml file.
+
+
+Vendor: Android Open Source Project
+Identifier: androidx.startup
+Feedback: https://issuetracker.google.com/issues/new?component=823348
+
++Identifier: androidx.startup
+Feedback: https://issuetracker.google.com/issues/new?component=823348
+
+
+
+
+EnsureInitializerNoArgConstr
+
+
+Every
+
+Initializer
must have a no argument constructor.
+Vendor: Android Open Source Project
+Identifier: androidx.startup
+Feedback: https://issuetracker.google.com/issues/new?component=823348
+
++Identifier: androidx.startup
+Feedback: https://issuetracker.google.com/issues/new?component=823348
+
+
+
+
+ExperimentalAnnotationRetention
+
+
+Experimental annotations defined in Java source should use default (
+
+CLASS
) retention, while Kotlin-sourced annotations should use BINARY
retention.
+Vendor: Android Open Source Project
+Identifier: androidx.annotation.experimental
+Feedback: https://issuetracker.google.com/issues/new?component=459778
+
++Identifier: androidx.annotation.experimental
+Feedback: https://issuetracker.google.com/issues/new?component=459778
+
+
+
+
+FragmentAddMenuProvider
+
+
+The Fragment lifecycle can result in a Fragment being active longer than its view. This can lead to unexpected behavior from lifecycle aware objects remaining active longer than the Fragment's view. To solve this issue, getViewLifecycleOwner() should be used as a LifecycleOwner rather than the Fragment instance once it is safe to access the view lifecycle in a Fragment's onCreateView, onViewCreated, onActivityCreated, or onViewStateRestored methods.
+
+
+Vendor: Android Open Source Project
+Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
++Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
+
+
+
+FragmentBackPressedCallback
+
+
+The Fragment lifecycle can result in a Fragment being active longer than its view. This can lead to unexpected behavior from lifecycle aware objects remaining active longer than the Fragment's view. To solve this issue, getViewLifecycleOwner() should be used as a LifecycleOwner rather than the Fragment instance once it is safe to access the view lifecycle in a Fragment's onCreateView, onViewCreated, onActivityCreated, or onViewStateRestored methods.
+
+
+Vendor: Android Open Source Project
+Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
++Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
+
+
+
+FragmentLiveDataObserve
+
+
+When observing a LiveData object from a fragment's onCreateView, onViewCreated, onActivityCreated, or onViewStateRestored method getViewLifecycleOwner() should be used as the LifecycleOwner rather than the Fragment instance. The Fragment lifecycle can result in the Fragment being active longer than its view. This can lead to unexpected behavior from LiveData objects being observed longer than the Fragment's view is active.
+
+
+Vendor: Android Open Source Project
+Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
++Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
+
+
+
+FragmentTagUsage
+
+
+FragmentContainerView replaces the <fragment> tag as the preferred way of adding fragments via XML. Unlike the <fragment> tag, FragmentContainerView uses a normal
+
+FragmentTransaction
under the hood to add the initial fragment, allowing further FragmentTransaction operations on the FragmentContainerView and providing a consistent timing for lifecycle events.More info: https://developer.android.com/reference/androidx/fragment/app/FragmentContainerView.html
+
+Vendor: Android Open Source Project
+Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
++Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
+
+
+
+IdleBatteryChargingConstraints
+
+
+Some devices are never considered charging and idle at the same time.
+Consider removing one of these constraints.
+
++Consider removing one of these constraints.
+Vendor: Android Open Source Project (work-runtime-2.7.0)
+Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
++Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
+
+
+
+InvalidFragmentVersionForActivityResult
+
+
+In order to use the ActivityResult APIs you must upgrade your Fragment version to 1.3.0. Previous versions of FragmentActivity failed to call super.onRequestPermissionsResult() and used invalid request codes
+
+
+Vendor: Android Open Source Project
+Identifier: androidx.activity
+Feedback: https://issuetracker.google.com/issues/new?component=527362
+
++Identifier: androidx.activity
+Feedback: https://issuetracker.google.com/issues/new?component=527362
+
+
+
+
+InvalidPeriodicWorkRequestInterval
+
+
+The interval duration for a
+
+PeriodicWorkRequest
must be at least 15 minutes.
+Vendor: Android Open Source Project (work-runtime-2.7.0)
+Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
++Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
+
+
+
+InvalidSetHasFixedSize
+
+
+When a RecyclerView uses
+
+setHasFixedSize(...)
you cannot use wrap_content
for size in the scrolling direction.
+Vendor: Android Open Source Project
+Identifier: androidx.recyclerview
+Feedback: https://issuetracker.google.com/issues/new?component=460887
+
++Identifier: androidx.recyclerview
+Feedback: https://issuetracker.google.com/issues/new?component=460887
+
+
+
+
+LogNotTimber
+
+
+Since Timber is included in the project, it is likely that calls to Log should instead be going to Timber.
+
+
+Identifier: jetified-timber-4.7.1
+
++
+
+
+
+NullSafeMutableLiveData
+
+
+This check ensures that LiveData values are not null when explicitly declared as non-nullable.
+
+ Kotlin interoperability does not support enforcing explicit null-safety when using generic Java type parameters. Since LiveData is a Java class its value can always be null even when its type is explicitly declared as non-nullable. This can lead to runtime exceptions from reading a null LiveData value that is assumed to be non-nullable.
+
++
+ Kotlin interoperability does not support enforcing explicit null-safety when using generic Java type parameters. Since LiveData is a Java class its value can always be null even when its type is explicitly declared as non-nullable. This can lead to runtime exceptions from reading a null LiveData value that is assumed to be non-nullable.
+Vendor: Android Open Source Project
+Identifier: androidx.lifecycle
+Feedback: https://issuetracker.google.com/issues/new?component=413132
+
++Identifier: androidx.lifecycle
+Feedback: https://issuetracker.google.com/issues/new?component=413132
+
+
+
+
+RemoveWorkManagerInitializer
+
+
+If an
+the default
+AndroidManifest.xml file.
+
+android.app.Application
implements androidx.work.Configuration.Provider
,+the default
androidx.startup.InitializationProvider
needs to be removed from the+AndroidManifest.xml file.
+Vendor: Android Open Source Project (work-runtime-2.7.0)
+Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
++Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
+
+
+
+RepeatOnLifecycleWrongUsage
+
+
+The repeatOnLifecycle APIs should be used when the View is created, that is in the
+
+onCreate
lifecycle method for Activities, or onViewCreated
in case you're using Fragments.
+Vendor: Android Open Source Project
+Identifier: androidx.lifecycle
+Feedback: https://issuetracker.google.com/issues/new?component=413132
+
++Identifier: androidx.lifecycle
+Feedback: https://issuetracker.google.com/issues/new?component=413132
+
+
+
+
+SpecifyForegroundServiceType
+
+
+When using the setForegroundAsync() API, the application must override <service /> entry for
+
+SystemForegroundService
to include the foreground service type in the AndroidManifest.xml
file.
+Vendor: Android Open Source Project (work-runtime-2.7.0)
+Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
++Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
+
+
+
+SpecifyJobSchedulerIdRange
+
+
+When using
+For more information look at
+
+JobScheduler
APIs directly, WorkManager
requires that developers specify a range of JobScheduler
ids that are safe for WorkManager
to use so the `id`s do not collide. +For more information look at
androidx.work.Configuration.Builder.setJobSchedulerJobIdRange(int, int)
.
+Vendor: Android Open Source Project (work-runtime-2.7.0)
+Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
++Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
+
+
+
+StringFormatInTimber
+
+
+Since Timber handles String.format automatically, you may not use String#format().
+
+
+Identifier: jetified-timber-4.7.1
+
++
+
+
+
+ThrowableNotAtBeginning
+
+
+In Timber you have to pass a Throwable at the beginning of the call.
+
+
+Identifier: jetified-timber-4.7.1
+
++
+
+
+
+TimberArgCount
+
+
+When a formatted string takes arguments, you need to pass at least that amount of arguments to the formatting call.
+
+
+Identifier: jetified-timber-4.7.1
+
++
+
+
+
+TimberArgTypes
+
+
+The argument types that you specified in your formatting string does not match the types of the arguments that you passed to your formatting call.
+
+
+Identifier: jetified-timber-4.7.1
+
++
+
+
+
+TimberExceptionLogging
+
+
+Explicitly including the exception message is redundant when supplying an exception to log.
+
+
+Identifier: jetified-timber-4.7.1
+
++
+
+
+
+TimberTagLength
+
+
+Log tags are only allowed to be at most 23 tag characters long.
+
+
+Identifier: jetified-timber-4.7.1
+
++
+
+
+
+UnsafeLifecycleWhenUsage
+
+
+If the
+
+Lifecycle
is destroyed within the block of Lifecycle.whenStarted
or any similar Lifecycle.when
method is suspended, the block will be cancelled, which will also cancel any child coroutine launched inside the block. As as a result, If you have a try finally block in your code, the finally might run after the Lifecycle moves outside the desired state. It is recommended to check the Lifecycle.isAtLeast
before accessing UI in finally block. Similarly, if you have a catch statement that might catch CancellationException
, you should check the Lifecycle.isAtLeast
before accessing the UI. See documentation of Lifecycle.whenStateAtLeast
for more details
+Vendor: Android Open Source Project
+Identifier: androidx.lifecycle
+Feedback: https://issuetracker.google.com/issues/new?component=413132
+
++Identifier: androidx.lifecycle
+Feedback: https://issuetracker.google.com/issues/new?component=413132
+
+
+
+
+UnsafeOptInUsageError
+
+
+This API has been flagged as opt-in with error-level severity.
+
+Any declaration annotated with this marker is considered part of an unstable or
+otherwise non-standard API surface and its call sites should accept the opt-in
+aspect of it by using the
+effectively causing further propagation of the opt-in aspect -- or configuring
+the
+
+To configure project-wide opt-in, specify the
+as a comma-delimited list of opted-in annotations:
+ +
+
++
+Any declaration annotated with this marker is considered part of an unstable or
+otherwise non-standard API surface and its call sites should accept the opt-in
+aspect of it by using the
@OptIn
annotation, using the marker annotation --+effectively causing further propagation of the opt-in aspect -- or configuring
+the
UnsafeOptInUsageError
check's options for project-wide opt-in.+
+To configure project-wide opt-in, specify the
opt-in
option value in lint.xml
+as a comma-delimited list of opted-in annotations:
+ +
+<lint> + <issue id="UnsafeOptInUsageError"> + <option name="opt-in" value="com.foo.ExperimentalBarAnnotation" /> + </issue> +</lint> ++
+Vendor: Android Open Source Project
+Identifier: androidx.annotation.experimental
+Feedback: https://issuetracker.google.com/issues/new?component=459778
+
++Identifier: androidx.annotation.experimental
+Feedback: https://issuetracker.google.com/issues/new?component=459778
+
+
+
+
+UnsafeOptInUsageWarning
+
+
+This API has been flagged as opt-in with warning-level severity.
+
+Any declaration annotated with this marker is considered part of an unstable or
+otherwise non-standard API surface and its call sites should accept the opt-in
+aspect of it by using the
+effectively causing further propagation of the opt-in aspect -- or configuring
+the
+
+To configure project-wide opt-in, specify the
+as a comma-delimited list of opted-in annotations:
+ +
+
++
+Any declaration annotated with this marker is considered part of an unstable or
+otherwise non-standard API surface and its call sites should accept the opt-in
+aspect of it by using the
@OptIn
annotation, using the marker annotation --+effectively causing further propagation of the opt-in aspect -- or configuring
+the
UnsafeOptInUsageWarning
check's options for project-wide opt-in.+
+To configure project-wide opt-in, specify the
opt-in
option value in lint.xml
+as a comma-delimited list of opted-in annotations:
+ +
+<lint> + <issue id="UnsafeOptInUsageWarning"> + <option name="opt-in" value="com.foo.ExperimentalBarAnnotation" /> + </issue> +</lint> ++
+Vendor: Android Open Source Project
+Identifier: androidx.annotation.experimental
+Feedback: https://issuetracker.google.com/issues/new?component=459778
+
++Identifier: androidx.annotation.experimental
+Feedback: https://issuetracker.google.com/issues/new?component=459778
+
+
+
+
+UnsafeRepeatOnLifecycleDetector
+
+
+The repeatOnLifecycle APIs should be used with the viewLifecycleOwner in Fragments as opposed to lifecycleOwner.
+
+
+Vendor: Android Open Source Project
+Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
++Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
+
+
+
+UseAndroidAlpha
+
+
+
+
+ColorStateList
uses app:alpha without android:alpha
+Vendor: Android Open Source Project
+Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
++Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
+
+
+
+UseAppTint
+
+
+
+
+ImageView
or ImageButton
uses android:tint
instead of app:tint
+Vendor: Android Open Source Project
+Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
++Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
+
+
+
+UseCompatLoadingForColorStateLists
+
+
+Use Compat loading of color state lists
+
+
+Vendor: Android Open Source Project
+Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
++Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
+
+
+
+UseCompatLoadingForDrawables
+
+
+Use Compat loading of drawables
+
+
+Vendor: Android Open Source Project
+Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
++Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
+
+
+
+UseCompatTextViewDrawableApis
+
+
+Use Compat loading of compound text view drawables
+
+
+Vendor: Android Open Source Project
+Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
++Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
+
+
+
+UseCompatTextViewDrawableXml
+
+
+
+
+TextView
uses android:
compound drawable attributes instead of app:
ones
+Vendor: Android Open Source Project
+Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
++Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
+
+
+
+UseGetLayoutInflater
+
+
+Using LayoutInflater.from(Context) can return a LayoutInflater that does not have the correct theme.
+
+
+Vendor: Android Open Source Project
+Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
++Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
+
+
+
+UseRequireInsteadOfGet
+
+
+AndroidX added new "require____()" versions of common "get___()" APIs, such as getContext/getActivity/getArguments/etc. Rather than wrap these in something like requireNotNull(), using these APIs will allow the underlying component to try to tell you _why_ it was null, and thus yield a better error message.
+
+
+Vendor: Android Open Source Project
+Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
++Identifier: androidx.fragment
+Feedback: https://issuetracker.google.com/issues/new?component=460964
+
+
+
+
+UseRxSetProgress2
+
+
+Use
+
+setCompletableProgress(...)
instead of `setProgress(...) in RxWorker
.
+Vendor: Android Open Source Project (work-runtime-2.7.0)
+Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
++Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
+
+
+
+UseSupportActionBar
+
+
+Use
+
+AppCompatActivity.setSupportActionBar
+Vendor: Android Open Source Project
+Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
++Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
+
+
+
+UseSwitchCompatOrMaterialCode
+
+
+Use
+
+SwitchCompat
from AppCompat or SwitchMaterial
from Material library
+Vendor: Android Open Source Project
+Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
++Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
+
+
+
+UseSwitchCompatOrMaterialXml
+
+
+Use
+
+SwitchCompat
from AppCompat or SwitchMaterial
from Material library
+Vendor: Android Open Source Project
+Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
++Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
+
+
+
+UsingOnClickInXml
+
+
+Old versions of the platform do not properly support resolving
+
+android:onClick
+Vendor: Android Open Source Project
+Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
++Identifier: androidx.appcompat
+Feedback: https://issuetracker.google.com/issues/new?component=460343
+
+
+
+
+WorkerHasAPublicModifier
+
+
+When you define a ListenableWorker which is constructed using the
+default WorkerFactory, the ListenableWorker sub-type needs to be public.
+
++default WorkerFactory, the ListenableWorker sub-type needs to be public.
+Vendor: Android Open Source Project (work-runtime-2.7.0)
+Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
++Identifier: work-runtime-2.7.0
+Feedback: https://issuetracker.google.com/issues/new?component=192731
+
+
+
+
+
+
+
+ Disabled Checks
+
+One or more issues were not run by lint, either
+because the check is not enabled by default, or because
+it was disabled with a command line flag or via one or
+more
+
+ lint.xml
configuration files in the project directories.
+
+
+AcceptsUserCertificates
+
+Disabled By: Project lint.xml file
+
++
+Allowing user certificates could allow eavesdroppers to intercept data sent by your app, 'which could impact the privacy of your users. Consider nesting your app's
+
+trust-anchors
inside a <debug-overrides>
element to make sure they are only available when android:debuggable
is set to "true"
.More info:
+
+
+AdapterViewChildren
+
+Disabled By: Project lint.xml file
+
++
+An
+
+AdapterView
such as a `ListView`s must be configured with data from Java code, such as a ListAdapter
.+
+
+AddJavascriptInterface
+
+Disabled By: Project lint.xml file
+
++
+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:
+
+
+AllCaps
+
+Disabled By: Project lint.xml file
+
++
+The textAllCaps text transform will end up calling
+
+toString
on the CharSequence
, which has the net effect of removing any markup such as <b>
. This check looks for usages of strings containing markup that also specify textAllCaps=true
.+
+
+AllowAllHostnameVerifier
+
+Disabled By: Project lint.xml file
+
++
+This check looks for 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: https://goo.gle/AllowAllHostnameVerifier
+
+
+
+AlwaysShowAction
+
+Disabled By: Project lint.xml file
+
++
+Using
+
+If
+
+This check looks for menu XML files that contain more than two
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+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
.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+AndroidGradlePluginVersion
+
+Disabled By: Project lint.xml file
+
++
+This detector looks for usage of the Android Gradle Plugin 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.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+AnimatorKeep
+
+Disabled By: Project lint.xml file
+
++
+When you use property animators, properties can be accessed via reflection. Those methods should be annotated with @Keep to ensure that during release builds, the methods are not potentially treated as unused and removed, or treated as internal only and get renamed to something shorter.
+
+This check will also flag other potential reflection problems it encounters, such as a missing property, wrong argument types, etc.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
++
+This check will also flag other potential reflection problems it encounters, such as a missing property, wrong argument types, etc.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+AnnotateVersionCheck
+
+Disabled By: Project lint.xml file
+
++
+Methods which perform
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+SDK_INT
version checks (or field constants which reflect the result of a version check) in libraries should be annotated with @ChecksSdkIntAtLeast
. This makes it possible for lint to correctly check calls into the library later to correctly understand that problematic code which is wrapped within a call into this library is safe after all.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+AnnotationProcessorOnCompilePath
+
+Disabled By: Project lint.xml file
+
++
+This dependency is identified as an annotation processor. Consider adding it to the processor path using
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+annotationProcessor
instead of including it to the compile path.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+AppBundleLocaleChanges
+
+Disabled By: Project lint.xml file
+
++
+When changing locales at runtime (e.g. to provide an in-app language switcher), the Android App Bundle must be configured to not split by locale or the Play Core library must be used to download additional locales at runtime.
+
+More info: https://developer.android.com/guide/app-bundle/configure-base#handling_language_changes
+
+
+
+AppCompatMethod
+
+Disabled By: Default
+
++
+When using the appcompat library, there are some methods you should be calling instead of the normal ones; for example,
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+getSupportActionBar()
instead of getActionBar()
. This lint check looks for calls to the wrong method.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+AppIndexingService
+
+Disabled By: Project lint.xml file
+
++
+Apps targeting Android 8.0 or higher can no longer rely on background services while listening for updates to the on-device index. Use a
+
+BroadcastReceiver
for the UPDATE_INDEX
intent to continue supporting indexing in your app.More info: https://firebase.google.com/docs/app-indexing/android/personal-content#add-a-broadcast-receiver-to-your-app
+
+
+
+AppLinksAutoVerify
+
+Disabled By: Default
+
++
+Ensures that app links are correctly set and associated with website.
+
+More info: https://g.co/appindexing/applinks
+
+
+
+ApplySharedPref
+
+Disabled By: Project lint.xml file
+
++
+Consider using
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+apply()
instead of commit
on shared preferences. Whereas commit
blocks and writes its data to persistent storage immediately, apply
will handle it in the background.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+AssertionSideEffect
+
+Disabled By: Project lint.xml file
+
++
+Assertion conditions can have side effects. This is risky because the behavior depends on whether assertions are on or off. This is usually not intentional, and can lead to bugs where the production version differs from the version tested during development.
+
+Generally, you'll want to perform the operation with the side effect before the assertion, and then assert that the result was what you expected.
+
++
+Generally, you'll want to perform the operation with the side effect before the assertion, and then assert that the result was what you expected.
+
+
+AuthLeak
+
+Disabled By: Project lint.xml file
+
++
+Strings in java apps can be discovered by decompiling apps, this lint check looks for code which looks like it may contain an url with a username and password
+
+More info: https://goo.gle/AuthLeak
+
+
+
+Autofill
+
+Disabled By: Project lint.xml file
+
++
+Specify an
+
+The hints can have any value, but it is recommended to use predefined values like 'username' for a username or 'creditCardNumber' for a credit card number. For a list of all predefined autofill hint constants, see the
+
+You can mark a view unimportant for autofill by specifying an
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+autofillHints
attribute when targeting SDK version 26 or higher or explicitly specify that the view is not important for autofill. Your app can help an autofill service classify the data correctly by providing the meaning of each view that could be autofillable, such as views representing usernames, passwords, credit card fields, email addresses, etc.+
+The hints can have any value, but it is recommended to use predefined values like 'username' for a username or 'creditCardNumber' for a credit card number. For a list of all predefined autofill hint constants, see the
AUTOFILL_HINT_
constants in the View
reference at https://developer.android.com/reference/android/view/View.html.+
+You can mark a view unimportant for autofill by specifying an
importantForAutofill
attribute on that view or a parent view. See https://developer.android.com/reference/android/view/View.html#setImportantForAutofill(int).Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+BackButton
+
+Disabled By: Default
+
++
+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.
+
++
+"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.
+
+
+BadHostnameVerifier
+
+Disabled By: Project lint.xml file
+
++
+This check looks for implementations of
+
+HostnameVerifier
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: https://goo.gle/BadHostnameVerifier
+
+
+
+BadPeriodicWorkRequestEnqueue
+
+Disabled By: Project lint.xml file
+
++
+When using
+duplicate requests unintentionally. You should be using
+
+
+enqueue()
for `PeriodicWorkRequest`s, you might end up enqueuing+duplicate requests unintentionally. You should be using
+
enqueueUniquePeriodicWork
with an ExistingPeriodicWorkPolicy.KEEP
instead.+
+
+BatteryLife
+
+Disabled By: Project lint.xml file
+
++
+This issue flags code that either
+* negatively affects battery life, or
+* uses APIs that have recently changed behavior to prevent background tasks from consuming memory and battery excessively.
+
+Generally, you should be using
+
+For more details on how to update your code, please see https://developer.android.com/topic/performance/background-optimization
+
++* negatively affects battery life, or
+* uses APIs that have recently changed behavior to prevent background tasks from consuming memory and battery excessively.
+
+Generally, you should be using
WorkManager
instead.+
+For more details on how to update your code, please see https://developer.android.com/topic/performance/background-optimization
+
+
+BinaryOperationInTimber
+
+Disabled By: Project lint.xml file
+
++
+Since Timber handles String#format() automatically, use this instead of String concatenation.
+
++
+
+BomWithoutPlatform
+
+Disabled By: Project lint.xml file
+
++
+When including a BOM, the dependency's coordinates must be wrapped in a call to
+
+platform()
for Gradle to interpret it correctly.+
+
+BrokenIterator
+
+Disabled By: Project lint.xml file
+
++
+For LinkedHashMap:
+
+The spliterators returned by
+
+For a Collection view
+
+Instead of
+
+For Vector:
+
+The
+
++
+The spliterators returned by
LinkedHashMap
in Android Nougat (API levels 24 and 25) use the wrong order (inconsistent with the iterators, which use the correct order), despite reporting Spliterator.ORDERED
. You may use the following code fragments to obtain a correctly ordered Spliterator
on API level 24 and 25:+
+For a Collection view
c = lhm.entrySet()
, c = lhm.keySet()
or c = lhm.values()
, use java.util.Spliterators.spliterator(c, c.spliterator().characteristics())
instead of c.spliterator()
.+
+Instead of
c.stream()
or c.parallelStream()
, use java.util.stream.StreamSupport.stream(spliterator, false)
to construct a (nonparallel) Stream from such a Spliterator
.+
+For Vector:
+
+The
listIterator()
returned for a Vector
has a broken add()
implementation on Android N (API level 24). Consider switching to ArrayList
and if necessary adding synchronization.+
+
+ButtonCase
+
+Disabled By: Project lint.xml file
+
++
+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.
+
++
+
+ButtonOrder
+
+Disabled By: Project lint.xml file
+
++
+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.
+
++
+"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.
+
+
+ButtonStyle
+
+Disabled By: Project lint.xml file
+
++
+Button bars typically use a borderless style for the buttons. Set the
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+style="?android:attr/buttonBarButtonStyle"
attribute on each of the buttons, and set style="?android:attr/buttonBarStyle"
on the parent layoutNote: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+CanvasSize
+
+Disabled By: Project lint.xml file
+
++
+In a custom view's draw implementation, you should normally call
+
+Canvas width and height are the width and height of the
+
+In the hardware accelerated path the width and height of the canvas typically always match that of the
+
+You should only use Canvas state to adjust how much you draw, such as a quick-reject for early work avoidance if it's going to be clipped away, but not what you draw.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+getWidth
and getHeight
on the custom view itself, not on the canvas
instance.+
+Canvas width and height are the width and height of the
Canvas
, which is not always the same as size of the view.+
+In the hardware accelerated path the width and height of the canvas typically always match that of the
View
because every view goes to its own recorded DisplayList
. But in software rendering there's just one canvas that is clipped and transformed as it makes its way through the View
tree, and otherwise remains the same Canvas
object for every View's draw method.+
+You should only use Canvas state to adjust how much you draw, such as a quick-reject for early work avoidance if it's going to be clipped away, but not what you draw.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+CheckResult
+
+Disabled By: Project lint.xml file
+
++
+Some methods have no side effects, and calling them without doing something with the result is suspicious.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+ChromeOsAbiSupport
+
+Disabled By: Project lint.xml file
+
++
+To properly support ChromeOS, your Android application should have an x86 and/or x86_64 binary as part of the build configuration. To fix the issue, ensure your files are properly optimized for ARM; the binary translator will then ensure compatibility with x86. Alternatively, add an
+
+
+abiSplit
for x86 within your build.gradle
file and create the required x86 dependencies.More info: https://developer.android.com/ndk/guides/abis
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+ChromeOsOnConfigurationChanged
+
+Disabled By: Project lint.xml file
+
++
+When users resize the Android emulator in Android 13 and Chrome OS, an
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+onConfigurationChanged()
API call occurs. If your onConfigurationChanged()
method contains any code that can cause a redraw, your app might take a performance hit on large screens. To fix the issue, ensure your onConfigurationChanged()
method does not contain any calls to UI redraw logic for specific elements.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+ClickableViewAccessibility
+
+Disabled By: Project lint.xml file
+
++
+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.+
+
+CommitPrefEdits
+
+Disabled By: Project lint.xml file
+
++
+After calling
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+edit()
on a SharedPreference
, you must call commit()
or apply()
on the editor to save the results.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+CommitTransaction
+
+Disabled By: Project lint.xml file
+
++
+After creating a
+
+FragmentTransaction
, you typically need to commit it as well+
+
+ConstantLocale
+
+Disabled By: Project lint.xml file
+
++
+Assigning
+
+Locale.getDefault()
to a constant is suspicious, because the locale can change while the app is running.+
+
+ContentDescription
+
+Disabled By: Project lint.xml file
+
++
+Non-textual widgets like ImageViews and ImageButtons should use the
+
+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, set their descriptions to
+
+Note that for text fields, you should not set both the
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+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, set their descriptions to
@null
. If your app's minSdkVersion is 16 or higher, you can instead set these graphical elements' android:importantForAccessibility
attributes to no
.+
+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
.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+ConvertToWebp
+
+Disabled By: Default
+
++
+The WebP format is typically more compact than PNG and JPEG. As of Android 4.2.1 it supports transparency and lossless conversion as well. Note that there is a quickfix in the IDE which lets you perform conversion.
+
+Previously, launcher icons were required to be in the PNG format but that restriction is no longer there, so lint now flags these.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
++
+Previously, launcher icons were required to be in the PNG format but that restriction is no longer there, so lint now flags these.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+CustomPermissionTypo
+
+Disabled By: Project lint.xml file
+
++
+This check looks for required permissions that look like custom permissions defined in the same manifest, but aren't, and may be typos.
+
+Please double check the permission value you have supplied.
+
++
+Please double check the permission value you have supplied.
More info: https://goo.gle/CustomPermissionTypo
+
+
+
+CustomSplashScreen
+
+Disabled By: Project lint.xml file
+
++
+Starting in Android 12 (API 31+), the application's Launch Screen is provided by the system and the application should not create its own, otherwise the user will see two splashscreens. Please check the
+
+SplashScreen
class to check how the Splash Screen can be controlled and customized.+
+
+CustomViewStyleable
+
+Disabled By: Project lint.xml file
+
++
+The convention for custom views is to use a
+
+(Similarly, layout parameter classes should use the suffix
+
+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
.)+
+
+CustomX509TrustManager
+
+Disabled By: Project lint.xml file
+
++
+This check looks for custom
+
+X509TrustManager
implementations.More info: https://goo.gle/CustomX509TrustManager
+
+
+
+CutPasteId
+
+Disabled By: Project lint.xml file
+
++
+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
.+
+
+DalvikOverride
+
+Disabled By: Default
+
++
+The Dalvik 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.
+
+If you really did intend for this method to override the other, make the method
+
+If you did not intend the override, consider making the method private, or changing its name or signature.
+
+Note that this check is disabled be default, because ART (the successor to Dalvik) no longer has this behavior.
+
++
+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.
+
+Note that this check is disabled be default, because ART (the successor to Dalvik) no longer has this behavior.
+
+
+DataBindingWithoutKapt
+
+Disabled By: Project lint.xml file
+
++
+Apps that use Kotlin and data binding should also apply the kotlin-kapt plugin.
+
+More info: https://kotlinlang.org/docs/reference/kapt.html
+
+
+
+DataExtractionRules
+
+Disabled By: Project lint.xml file
+
++
+Before Android 12, the attributes
+
+In Android 12 and higher, these attributes have been deprecated and will only apply to cloud backups. You should instead use the attribute
+
+
+android:allowBackup
and android:fullBackupContent
were used to configure all forms of backup, including cloud backups, device-to-device transfers and adb backup.+
+In Android 12 and higher, these attributes have been deprecated and will only apply to cloud backups. You should instead use the attribute
android:dataExtractionRules
, specifying an @xml
resource that configures which files to back up, for cloud backups and for device-to-device transfers, separately. If your minSdkVersion
supports older versions, you'll still want to specify an android:fullBackupContent
resource if the default behavior is not right for your app.More info:
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+DeepLinkInActivityDestination
+
+Disabled By: Project lint.xml file
+
++
+Attaching a <deeplink> to an <activity> destination will never give the right behavior when using an implicit deep link on another app's task (where the system back should immediately take the user back to the app that triggered the deep link). Instead, attach the deep link directly to the second activity (either by manually writing the appropriate <intent-filter> or by adding the <deeplink> to the start destination of a nav host in that second activity).
+
++
+
+DefaultEncoding
+
+Disabled By: Default
+
++
+Some APIs will implicitly use the default system character encoding instead of UTF-8 when converting to or from bytes, such as when creating a default
+
+This is usually not correct; you only want to do this if you need to read files created by other programs where they have deliberately written in the same encoding. The default encoding varies from platform to platform and can vary from locale to locale, so this makes it difficult to interpret files containing non-ASCII characters.
+
+We recommend using UTF-8 everywhere.
+
+Note that on Android, the default file encoding is always UTF-8 (see https://developer.android.com/reference/java/nio/charset/Charset#defaultCharset() for more), so this lint check deliberately does not flag any problems in Android code, since it is always safe to rely on the default character encoding there.
+
+FileReader
.+
+This is usually not correct; you only want to do this if you need to read files created by other programs where they have deliberately written in the same encoding. The default encoding varies from platform to platform and can vary from locale to locale, so this makes it difficult to interpret files containing non-ASCII characters.
+
+We recommend using UTF-8 everywhere.
+
+Note that on Android, the default file encoding is always UTF-8 (see https://developer.android.com/reference/java/nio/charset/Charset#defaultCharset() for more), so this lint check deliberately does not flag any problems in Android code, since it is always safe to rely on the default character encoding there.
+
+
+DefaultLocale
+
+Disabled By: Project lint.xml file
+
++
+Calling
+
+If you want the methods to just perform ASCII replacement, for example to convert an enum name, call
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+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.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+Deprecated
+
+Disabled By: Project lint.xml file
+
++
+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.
+
++
+
+DeprecatedProvider
+
+Disabled By: Project lint.xml file
+
++
+The
+
+BC
provider has been deprecated and will not be provided when targetSdkVersion
is P or higher.More info:
+
+
+DeprecatedSinceApi
+
+Disabled By: Project lint.xml file
+
++
+Some backport methods are only necessary until a specific version of Android. These have been annotated with
+
+@DeprecatedSinceApi
, specifying the relevant API level and replacement suggestions. Calling these methods when the minSdkVersion
is already at the deprecated API level or above is unnecessary.+
+
+DetachAndAttachSameFragment
+
+Disabled By: Project lint.xml file
+
++
+When doing a FragmentTransaction that includes both attach() and detach() operations being committed on the same fragment instance, it is a no-op. The reason for this is that the FragmentManager optimizes all operations within a single transaction so the attach() and detach() cancel each other out and neither is actually executed. To get the desired behavior, you should separate the attach() and detach() calls into separate FragmentTransactions.
+
++
+
+DevModeObsolete
+
+Disabled By: Project lint.xml file
+
++
+In the past, our documentation recommended creating a
+
+That workaround is no longer necessary, and it has some serious downsides, such as breaking API access checking (since the true
+
+In recent versions of the IDE and the Gradle plugin, the IDE automatically passes the API level of the connected device used for deployment, and if that device is at least API 21, then multidexing is automatically turned on, meaning that you get the same speed benefits as the
+
+dev
product flavor with has a minSdkVersion of 21, in order to enable multidexing to speed up builds significantly during development.+
+That workaround is no longer necessary, and it has some serious downsides, such as breaking API access checking (since the true
minSdkVersion
is no longer known).+
+In recent versions of the IDE and the Gradle plugin, the IDE automatically passes the API level of the connected device used for deployment, and if that device is at least API 21, then multidexing is automatically turned on, meaning that you get the same speed benefits as the
dev
product flavor but without the downsides.+
+
+DeviceAdmin
+
+Disabled By: Project lint.xml file
+
++
+If you register a broadcast receiver which acts as a device admin, you must also register an
+
+To do this, add +
+
+<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>
.+
+
+DialogFragmentCallbacksDetector
+
+Disabled By: Project lint.xml file
+
++
+When using a
+
+DialogFragment
, the setOnCancelListener
and setOnDismissListener
callback functions within the onCreateDialog
function __must not be used__ because the DialogFragment
owns these callbacks. Instead the respective onCancel
and onDismiss
functions can be used to achieve the desired effect.+
+
+DisableBaselineAlignment
+
+Disabled By: Project lint.xml file
+
++
+When a
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+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.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+DiscouragedApi
+
+Disabled By: Project lint.xml file
+
++
+Discouraged APIs are allowed and are not deprecated, but they may be unfit for common use (e.g. due to slow performance or subtle behavior).
+
++
+
+DiscouragedPrivateApi
+
+Disabled By: Project lint.xml file
+
++
+Usage of restricted non-SDK interface may throw an exception at runtime. Accessing non-SDK methods or fields through reflection has a high likelihood to break your app between versions, and is being restricted to facilitate future app compatibility.
+
++
+
+DrawAllocation
+
+Disabled By: Project lint.xml file
+
++
+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
+
++
+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.+
+
+DuplicateDivider
+
+Disabled By: Project lint.xml file
+
++
+Older versions of the RecyclerView library did not include a divider decorator, but one was provided as a sample in the support demos. This divider class has been widely copy/pasted into various projects.
+
+In recent versions of the support library, the divider decorator is now included, so you can replace custom copies with the "built-in" version,
+
++
+In recent versions of the support library, the divider decorator is now included, so you can replace custom copies with the "built-in" version,
android.support.v7.widget.DividerItemDecoration
.+
+
+DuplicateIncludedIds
+
+Disabled By: Project lint.xml file
+
++
+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.+
+
+DuplicateStrings
+
+Disabled By: Default
+
++
+Duplicate strings can make applications larger unnecessarily.
+
+This lint check looks for duplicate strings, including differences for strings where the only difference is in capitalization. Title casing and all uppercase can all be adjusted in the layout or in code.
+
++
+This lint check looks for duplicate strings, including differences for strings where the only difference is in capitalization. Title casing and all uppercase can all be adjusted in the layout or in code.
More info: https://developer.android.com/reference/android/widget/TextView.html#attr_android:inputType
+
+
+
+DuplicateUsesFeature
+
+Disabled By: Project lint.xml file
+
++
+A given feature should only be declared once in the manifest.
+
++
+
+EasterEgg
+
+Disabled By: Default
+
++
+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.
+
++
+
+EmptySuperCall
+
+Disabled By: Project lint.xml file
+
++
+For methods annotated with
+
+@EmptySuper
, overriding methods should not also call the super implementation, either because it is empty, or perhaps it contains code not intended to be run when the method is overridden.+
+
+EnqueueWork
+
+Disabled By: Project lint.xml file
+
++
+
+
+WorkContinuations
cannot be enqueued automatically. You must call enqueue()
on a WorkContinuation
to have it and its parent continuations enqueued inside WorkManager
.+
+
+ExifInterface
+
+Disabled By: Project lint.xml file
+
++
+The
+
+android.media.ExifInterface
implementation has some known security bugs in older versions of Android. There is a new implementation available of this library in the support library, which is preferable.+
+
+ExpensiveAssertion
+
+Disabled By: Default
+
++
+In Kotlin, assertions are not handled the same way as from the Java programming language. In particular, they're just implemented as a library call, and inside the library call the error is only thrown if assertions are enabled.
+
+This means that the arguments to the
+
+This check looks for cases where the assertion condition is nontrivial, e.g. it is performing method calls or doing more work than simple comparisons on local variables or fields.
+
+You can work around this by writing your own inline assert method instead:
+ +
+In Android, because assertions are not enforced at runtime, instead use this:
+ +
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
++
+This means that the arguments to the
assert
call will always be evaluated. If you're doing any computation in the expression being asserted, that computation will unconditionally be performed whether or not assertions are turned on. This typically turns into wasted work in release builds.+
+This check looks for cases where the assertion condition is nontrivial, e.g. it is performing method calls or doing more work than simple comparisons on local variables or fields.
+
+You can work around this by writing your own inline assert method instead:
+ +
+@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") +inline fun assert(condition: () -> Boolean) { + if (_Assertions.ENABLED && !condition()) { + throw AssertionError() + } +} ++
+In Android, because assertions are not enforced at runtime, instead use this:
+ +
+inline fun assert(condition: () -> Boolean) { + if (BuildConfig.DEBUG && !condition()) { + throw AssertionError() + } +} ++
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+ExpiringTargetSdkVersion
+
+Disabled By: Project lint.xml file
+
++
+Configuring your app to target a recent API level ensures that users benefit from significant security and performance improvements, while still allowing your app to run on older Android versions (down to the
+
+To update your
+
+
+minSdkVersion
).+
+To update your
targetSdkVersion
, follow the steps from "Meeting Google Play requirements for target API level", https://developer.android.com/distribute/best-practices/develop/target-sdk.htmlMore info:
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+ExportedContentProvider
+
+Disabled By: Project lint.xml file
+
++
+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: https://goo.gle/ExportedContentProvider
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+ExportedPreferenceActivity
+
+Disabled By: Project lint.xml file
+
++
+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:
+
+
+ExportedReceiver
+
+Disabled By: Project lint.xml file
+
++
+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: https://goo.gle/ExportedReceiver
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+ExportedService
+
+Disabled By: Project lint.xml file
+
++
+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: https://goo.gle/ExportedService
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+FileEndsWithExt
+
+Disabled By: Project lint.xml file
+
++
+The Kotlin extension method
+
+File.endsWith(suffix)
checks whole path components, not just string suffixes. This means that File("foo.txt").endsWith(".txt")
will return false. Instead you might have intended file.path.endsWith
or file.extension.equals
.+
+
+FindViewByIdCast
+
+Disabled By: Project lint.xml file
+
++
+In Android O, the
+
+However, due to language changes between Java 7 and 8, this change may cause code to not compile without explicit casts. This lint check looks for these scenarios and suggests casts to be added now such that the code will continue to compile if the language level is updated to 1.8.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+findViewById
signature switched to using generics, which means that most of the time you can leave out explicit casts and just assign the result of the findViewById
call to variables of specific view classes.+
+However, due to language changes between Java 7 and 8, this change may cause code to not compile without explicit casts. This lint check looks for these scenarios and suggests casts to be added now such that the code will continue to compile if the language level is updated to 1.8.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+FragmentTagUsage
+
+Disabled By: Project lint.xml file
+
++
+FragmentContainerView replaces the <fragment> tag as the preferred way of adding fragments via XML. Unlike the <fragment> tag, FragmentContainerView uses a normal
+
+FragmentTransaction
under the hood to add the initial fragment, allowing further FragmentTransaction operations on the FragmentContainerView and providing a consistent timing for lifecycle events.More info: https://developer.android.com/reference/androidx/fragment/app/FragmentContainerView.html
+
+
+
+GestureBackNavigation
+
+Disabled By: Project lint.xml file
+
++
+Starting in Android 13 (API 33+), the handling of back events is moving to an ahead-of-time callback model. Use
+
+OnBackInvokedDispatcher.registerOnBackInvokedCallback(...)
and onBackInvokedCallback
or AndroidX's OnBackPressedDispatcher
with an implemented onBackPressedCallback
to handle back gestures and key presses.+
+
+GetInstance
+
+Disabled By: Project lint.xml file
+
++
+
+
+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: https://goo.gle/GetInstance
+
+
+
+GifUsage
+
+Disabled By: Project lint.xml file
+
++
+The
+
+.gif
file format is discouraged. Consider using .png
(preferred) or .jpg
(acceptable) instead.+
+
+GradleDependency
+
+Disabled By: Project lint.xml file
+
++
+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.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+GradleDeprecated
+
+Disabled By: Project lint.xml file
+
++
+This detector looks for deprecated Gradle constructs which currently work but will likely stop working in a future update.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+GradleDeprecatedConfiguration
+
+Disabled By: Project lint.xml file
+
++
+Some Gradle configurations have been deprecated since Android Gradle Plugin 3.0.0 and will be removed in a future version of the Android Gradle Plugin.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+GradleDynamicVersion
+
+Disabled By: Project lint.xml file
+
++
+Using
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
++
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.)Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+GradleOverrides
+
+Disabled By: Project lint.xml file
+
++
+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.+
+
+GradlePath
+
+Disabled By: Project lint.xml file
+
++
+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
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+GrantAllUris
+
+Disabled By: Project lint.xml file
+
++
+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: https://goo.gle/GrantAllUris
+
+
+
+HandlerLeak
+
+Disabled By: Project lint.xml file
+
++
+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.+
+
+HardcodedText
+
+Disabled By: Project lint.xml file
+
++
+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.
+
+There are quickfixes to automatically extract this hardcoded string into a resource lookup.
+
++
+* 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.
+
+There are quickfixes to automatically extract this hardcoded string into a resource lookup.
+
+
+HardwareIds
+
+Disabled By: Project lint.xml file
+
++
+Using these device identifiers is not recommended other than for high value fraud prevention and advanced telephony use-cases. For advertising use-cases, use
+
+AdvertisingIdClient$Info#getId
and for analytics, use InstanceId#getId
.+
+
+HighSamplingRate
+
+Disabled By: Project lint.xml file
+
++
+Most apps don't need access to high sensor sampling rate. Double check your use case to ensure your app absolutely needs access to sensor sampling rate > 200Hz. Be prepared for your app to be rejected from listing on Play Store until your use case for high sensor sampling rate has been reviewed and validated by the policy team.
+
++
+
+IconColors
+
+Disabled By: Project lint.xml file
+
++
+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 https://d.android.com/r/studio-ui/designer/material/iconography+
+
+IconDensities
+
+Disabled By: Project lint.xml file
+
++
+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
+
++
+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 https://developer.android.com/about/dashboards+
+
+IconDipSize
+
+Disabled By: Project lint.xml file
+
++
+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.+
+
+IconDuplicates
+
+Disabled By: Project lint.xml file
+
++
+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.
+
++
+
+IconDuplicatesConfig
+
+Disabled By: Project lint.xml file
+
++
+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.+
+
+IconExpectedSize
+
+Disabled By: Default
+
++
+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.
+
++
+
+IconExtension
+
+Disabled By: Project lint.xml file
+
++
+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
).+
+
+IconLauncherShape
+
+Disabled By: Project lint.xml file
+
++
+According to the Android Design Guide (https://d.android.com/r/studio-ui/designer/material/iconography) 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.
+
++
+The unique silhouette implies that your launcher icon should not be a filled square.
+
+
+IconLocation
+
+Disabled By: Project lint.xml file
+
++
+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
.+
+
+IconMissingDensityFolder
+
+Disabled By: Project lint.xml file
+
++
+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
+
+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
+
+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 https://developer.android.com/about/dashboards+
+
+IconMixedNinePatch
+
+Disabled By: Project lint.xml file
+
++
+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.+
+
+IconNoDpi
+
+Disabled By: Project lint.xml file
+
++
+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.+
+
+IconXmlAndPng
+
+Disabled By: Project lint.xml file
+
++
+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.+
+
+IdleBatteryChargingConstraints
+
+Disabled By: Project lint.xml file
+
++
+Some devices are never considered charging and idle at the same time.
+Consider removing one of these constraints.
+
++Consider removing one of these constraints.
+
+
+IgnoreWithoutReason
+
+Disabled By: Project lint.xml file
+
++
+Ignoring a test without a reason makes it difficult to figure out the problem later. Please define an explicit reason why it is ignored, and when it can be resolved.
+This check can be configured via the following options:
+
+
+
++This check can be configured via the following options:
+
+allow-comments (default is true):
+Whether to allow a comment next to the @Ignore tag to be considered providing a reason.
+
+Normally you have to specify an annotation argument to the
+
+To configure this option, use a `lint.xml` file in the project or source folder using an
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+Whether to allow a comment next to the @Ignore tag to be considered providing a reason.
+
+Normally you have to specify an annotation argument to the
@Ignore
annotation, but with this option you can configure whether it should also allow ignore reasons to specified by a comment adjacent to the ignore tag.+
+To configure this option, use a `lint.xml` file in the project or source folder using an
<option>
block like the following:
++ 1 <lint> + 2 <issue id="IgnoreWithoutReason"> + 3 <option name="allow-comments" value="true" /> + 4 </issue> + 5 </lint> ++
+
+
+
+IllegalResourceRef
+
+Disabled By: Project lint.xml file
+
++
+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.+
+
+ImplicitSamInstance
+
+Disabled By: Default
+
++
+Kotlin's support for SAM (single accessor method) interfaces lets you pass a lambda to the interface. This will create a new instance on the fly even though there is no explicit constructor call. If you pass one of these lambdas or method references into a method which (for example) stores or compares the object identity, unexpected results may happen.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+InOrMmUsage
+
+Disabled By: Project lint.xml file
+
++
+Avoid using
+
+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
+
+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
).+
+
+IncompatibleMediaBrowserServiceCompatVersion
+
+Disabled By: Project lint.xml file
+
++
+
+
+MediaBrowserServiceCompat
from version 23.2.0 to 23.4.0 of the Support v4 Library used private APIs and will not be compatible with future versions of Android beyond Android N. Please upgrade to version 24.0.0 or higher of the Support Library.+
+
+InconsistentArrays
+
+Disabled By: Project lint.xml file
+
++
+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 judgment to decide if this is really an error.
+
+You can suppress this error type if it finds false errors in your project.
+
++
+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 judgment to decide if this is really an error.
+
+You can suppress this error type if it finds false errors in your project.
+
+
+InconsistentLayout
+
+Disabled By: Project lint.xml file
+
++
+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
+
+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
+
++
+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
+
+
+InefficientWeight
+
+Disabled By: Project lint.xml file
+
++
+When only a single widget in a
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+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.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+InflateParams
+
+Disabled By: Project lint.xml file
+
++
+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.
+
++
+
+InlinedApi
+
+Disabled By: Project lint.xml file
+
++
+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 decide whether it's safe and can be suppressed or whether the code needs to be guarded.
+
+If you really want to use this API and don't need to support older devices just set the
+
+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
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
++
+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.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+InnerclassSeparator
+
+Disabled By: Project lint.xml file
+
++
+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.)
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
++
+(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.)
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+InsecureBaseConfiguration
+
+Disabled By: Project lint.xml file
+
++
+Permitting cleartext traffic could allow eavesdroppers to intercept data sent by your app, which impacts the privacy of your users. Consider only allowing encrypted traffic by setting the
+
+
+cleartextTrafficPermitted
tag to "false"
.More info:
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+InstantApps
+
+Disabled By: Project lint.xml file
+
++
+This issue flags code that will not work correctly in Instant Apps
+
++
+
+IntentFilterExportedReceiver
+
+Disabled By: Project lint.xml file
+
++
+Apps targeting Android 12 and higher are required to specify an explicit value for
+
+Previously,
+
+While the default without intent filters remains unchanged, it is now required to explicitly specify a value when intent filters are present. Any app failing to meet this requirement will fail to install on any Android version after Android 11.
+
+We recommend setting
+
+
+android:exported
when the corresponding component has an intent filter defined. Otherwise, installation will fail. Set it to true
to make this activity accessible to other apps, and false
to limit it to be used only by this app or the OS. For launch activities, this should be set to true; otherwise, the app will fail to launch.+
+Previously,
android:exported
for components without any intent filters present used to default to false
, and when intent filters were present, the default was true
. Defaults which change value based on other values are confusing and lead to apps accidentally exporting components as a side-effect of adding intent filters. This is a security risk, and we have made this change to avoid introducing accidental vulnerabilities.+
+While the default without intent filters remains unchanged, it is now required to explicitly specify a value when intent filters are present. Any app failing to meet this requirement will fail to install on any Android version after Android 11.
+
+We recommend setting
android:exported
to false (even on previous versions of Android prior to this requirement) unless you have a good reason to export a particular component.More info: https://goo.gle/IntentFilterExportedReceiver
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+IntentFilterUniqueDataAttributes
+
+Disabled By: Project lint.xml file
+
++
+
+
+For example, the following two
+They both handle all of the following:
+* http://example.com
+* https://example.com
+* http://example.org
+* https://example.org
+
+The second one better communicates the combining behavior and is clearer to an external reader that one should not rely on the scheme/host being self contained. It is not obvious in the first that http://example.org is also matched, which can lead to confusion (or incorrect behavior) with a more complex set of schemes/hosts.
+
+Note that this does not apply to host + port, as those must be declared in the same
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+<intent-filter>
<data>
tags should only declare a single unique attribute (i.e. scheme OR host, but not both). This better matches the runtime behavior of intent filters, as they combine all of the declared data attributes into a single matcher which is allowed to handle any combination across attribute types.+
+For example, the following two
<intent-filter>
declarations are the same:
++<intent-filter> + <data android:scheme="http" android:host="example.com" /> + <data android:scheme="https" android:host="example.org" /> +</intent-filter> ++ +
+<intent-filter> + <data android:scheme="http"/> + <data android:scheme="https"/> + <data android:host="example.com" /> + <data android:host="example.org" /> +</intent-filter> ++
+They both handle all of the following:
+* http://example.com
+* https://example.com
+* http://example.org
+* https://example.org
+
+The second one better communicates the combining behavior and is clearer to an external reader that one should not rely on the scheme/host being self contained. It is not obvious in the first that http://example.org is also matched, which can lead to confusion (or incorrect behavior) with a more complex set of schemes/hosts.
+
+Note that this does not apply to host + port, as those must be declared in the same
<data>
tag and are only associated with each other.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+IntentReset
+
+Disabled By: Project lint.xml file
+
++
+Intent provides the following APIs:
+
+setData(Uri)
and setType(String)
. Unfortunately, setting one clears the other. If you want to set both, you should call setDataAndType(Uri, String)
instead.+
+
+IntentWithNullActionLaunch
+
+Disabled By: Project lint.xml file
+
++
+Intents that have no action and do not specify a component are a potential security risk, and using them will result in a crash in an upcoming version of Android. If a specific app is being targeted (including the case where the current app is the target) then set the targeted component using
+
+setComponent()
, setClass()
, setClassName()
, or the Intent constructors that take a Class parameter. If the intent is not intended for a specific app then the action name should be set.+
+
+InternalInsetResource
+
+Disabled By: Project lint.xml file
+
++
+The internal inset dimension resources are not a supported way to retrieve the relevant insets for your application. The insets are dynamic values that can change while your app is visible, and your app's window may not intersect with the system UI. To get the relevant value for your app and listen to updates, use
+
+androidx.core.view.WindowInsetsCompat
and related APIs.+
+
+InvalidNavigation
+
+Disabled By: Project lint.xml file
+
++
+All
+
+<navigation>
elements must have a start destination specified, and it must be a direct child of that <navigation>
.+
+
+InvalidPackage
+
+Disabled By: Default
+
++
+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.
+
++
+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.
+
+
+JavaPluginLanguageLevel
+
+Disabled By: Project lint.xml file
+
++
+In modules using plugins deriving from the Gradle
+
+You can specify an explicit sourceCompatibility and targetCompatibility in this module to maintain compatibility no matter which JDK is used to run Gradle.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+java
plugin (e.g. java-library
or application
), the java source and target compatibility default to the version of the JDK being used to run Gradle, which may cause compatibility problems with Android (or other) modules.+
+You can specify an explicit sourceCompatibility and targetCompatibility in this module to maintain compatibility no matter which JDK is used to run Gradle.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+JcenterRepositoryObsolete
+
+Disabled By: Project lint.xml file
+
++
+The JCenter Maven repository is no longer accepting submissions of Maven artifacts since 31st March 2021. Ensure that the project is configured to search in repositories with the latest versions of its dependencies.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+JobSchedulerService
+
+Disabled By: Project lint.xml file
+
++
+This check looks for various common mistakes in using the JobScheduler API: the service class must extend
+
+JobService
, the service must be registered in the manifest and the registration must require the permission android.permission.BIND_JOB_SERVICE
.+
+
+KaptUsageInsteadOfKsp
+
+Disabled By: Project lint.xml file
+
++
+KSP is a more efficient replacement for kapt. For libraries that support both, KSP should be used to improve build times.
+
++
+
+KeyboardInaccessibleWidget
+
+Disabled By: Project lint.xml file
+
++
+A widget that is declared to be clickable but not declared to be focusable is not accessible via the keyboard. Please add the
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+focusable
attribute as well.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+KotlinPropertyAccess
+
+Disabled By: Default
+
++
+For a method to be represented as a property in Kotlin, strict “bean”-style prefixing must be used.
+
+Accessor methods require a
+
++
+Accessor methods require a
get
prefix or for boolean-returning methods an is
prefix can be used.+
+
+KotlincFE10
+
+Disabled By: Default
+
++
+K2, the new version of Kotlin compiler, which encompasses the new frontend, is coming. Try to avoid using internal APIs from the old frontend if possible.
+
++
+
+KtxExtensionAvailable
+
+Disabled By: Project lint.xml file
+
++
+Android KTX extensions augment some libraries with support for modern Kotlin language features like extension functions, extension properties, lambdas, named parameters, coroutines, and more.
+
+In Kotlin projects, use the KTX version of a library by replacing the dependency in your
+
+
++
+In Kotlin projects, use the KTX version of a library by replacing the dependency in your
build.gradle
file. For example, you can replace androidx.fragment:fragment
with androidx.fragment:fragment-ktx
.More info: https://developer.android.com/kotlin/ktx
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+LabelFor
+
+Disabled By: Project lint.xml file
+
++
+Editable text fields should provide an
+
+When using
+
+If your view is labeled but by a label in a different layout which includes this one, just suppress this warning from lint.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+android:hint
or, provided your minSdkVersion
is at least 17, they may be referenced by a view with a android:labelFor
attribute.+
+When using
android:labelFor
, be sure to provide an android:text
or an android:contentDescription
.+
+If your view is labeled but by a label in a different layout which includes this one, just suppress this warning from lint.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+LambdaLast
+
+Disabled By: Default
+
++
+To improve calling this code from Kotlin, parameter types eligible for SAM conversion should be last.
+
++
+
+LaunchActivityFromNotification
+
+Disabled By: Project lint.xml file
+
++
+Notifications should only launch activities -- that's what users expect (and has been the guidance in both the Android SDK and Material Design documentation for a while).
+
+A
+
++
+A
Service
or a BroadcastReceiver
should not be used as an intermediate, because this can lead to significant performance problems, and as a result, this will not be allowed in Android 12.More info:
+
+
+LeanbackUsesWifi
+
+Disabled By: Project lint.xml file
+
++
+WiFi is not required for Android TV and many devices connect to the internet via alternative methods e.g. Ethernet.
+
+If your app is not focused specifically on WiFi functionality and only wishes to connect to the internet, please modify your Manifest to contain:
+
+Un-metered or non-roaming connections can be detected in software using
+
++
+If your app is not focused specifically on WiFi functionality and only wishes to connect to the internet, please modify your Manifest to contain:
<uses-feature android:name="android.hardware.wifi" android:required="false" />
+
+Un-metered or non-roaming connections can be detected in software using
NetworkCapabilities#NET_CAPABILITY_NOT_METERED
and NetworkCapabilities#NET_CAPABILITY_NOT_ROAMING.
+
+
+LifecycleAnnotationProcessorWithJava8
+
+Disabled By: Project lint.xml file
+
++
+For faster incremental build, switch to the Lifecycle Java 8 API with these steps:
+
+First replace +
+
++
+First replace +
+annotationProcessor "androidx.lifecycle:lifecycle-compiler:*version*" +kapt "androidx.lifecycle:lifecycle-compiler:*version*" ++with +
+implementation "androidx.lifecycle:lifecycle-common-java8:*version*" ++Then remove any
OnLifecycleEvent
annotations from Observer
classes and make them implement the DefaultLifecycleObserver
interface.+
+
+LintDocExample
+
+Disabled By: Default
+
++
+Lint's tool for generating documentation for each issue has special support for including a code example which shows how to trigger the report. It will pick the first unit test it can find and pick out the source file referenced from the error message, but you can instead designate a unit test to be the documentation example, and in that case, all the files are included.
+
+To designate a unit test as the documentation example for an issue, name the test
+
++
+To designate a unit test as the documentation example for an issue, name the test
testDocumentationExample
, or if your detector reports multiple issues, testDocumentationExample
<Id>, such as testDocumentationExampleMyId
.+
+
+LintImplPsiEquals
+
+Disabled By: Default
+
++
+You should never compare two PSI elements for equality with
+
+equals
; use isEquivalentTo(PsiElement)
instead.+
+
+LintImplTextFormat
+
+Disabled By: Project lint.xml file
+
++
+Lint supports various markdown like formatting directives in all of its strings (issue explanations, reported error messages, etc).
+
+This lint check looks for strings that look like they may benefit from additional formatting. For example, if a snippet looks like code it should be surrounded with backticks.
+
+Note: Be careful changing existing strings; this may stop baseline file matching from working, so consider suppressing existing violations of this check if this is an error many users may be filtering in baselines. (This is only an issue for strings used in
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
++
+This lint check looks for strings that look like they may benefit from additional formatting. For example, if a snippet looks like code it should be surrounded with backticks.
+
+Note: Be careful changing existing strings; this may stop baseline file matching from working, so consider suppressing existing violations of this check if this is an error many users may be filtering in baselines. (This is only an issue for strings used in
report
calls; for issue registration strings like summaries and explanations there's no risk changing the text contents.)Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+LintImplUnexpectedDomain
+
+Disabled By: Default
+
++
+This checks flags URLs to domains that have not been explicitly allowed for use as a documentation source.
+
++
+
+LintImplUseKotlin
+
+Disabled By: Project lint.xml file
+
++
+New lint checks should be written in Kotlin; the Lint API is written in Kotlin and uses a number of language features that makes it beneficial to also write the lint checks in Kotlin. Examples include many extension functions (as well as in UAST), default and named parameters (for the Issue registration methods for example where there are methods with 12+ parameters with only a couple of required ones), and so on.
+
++
+
+LocaleFolder
+
+Disabled By: Project lint.xml file
+
++
+From the
+"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
+
+To work around this, place your resources in a
+
+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.+
+
+LockedOrientationActivity
+
+Disabled By: Project lint.xml file
+
++
+The
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+<activity>
element should not be locked to any orientation so that users can take advantage of the multi-window environments and larger screens available on Android. To fix the issue, consider declaring the corresponding activity element with `screenOrientation="unspecified"or
"fullSensor"` attribute.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+LogConditional
+
+Disabled By: Default
+
++
+The
+
+If you really intend for the logging to be present in release mode, you can suppress this warning with a
+
+BuildConfig
class 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.+
+
+LogNotTimber
+
+Disabled By: Project lint.xml file
+
++
+Since Timber is included in the project, it is likely that calls to Log should instead be going to Timber.
+
++
+
+MangledCRLF
+
+Disabled By: Default
+
++
+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.
+
++
+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
+
+
+
+ManifestOrder
+
+Disabled By: Project lint.xml file
+
++
+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.+
+
+MergeRootFrame
+
+Disabled By: Project lint.xml file
+
++
+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: https://android-developers.googleblog.com/2009/03/android-layout-tricks-3-optimize-by.html
+
+
+
+MinSdkTooLow
+
+Disabled By: Default
+
++
+The value of the
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+minSdkVersion
property is too low and can be incremented without noticeably reducing the number of supported devices.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+MipmapIcons
+
+Disabled By: Project lint.xml file
+
++
+Launcher icons should be provided in the
+
+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.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+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.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+MissingApplicationIcon
+
+Disabled By: Project lint.xml file
+
++
+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
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+@drawable/icon
).Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+MissingBackupPin
+
+Disabled By: Project lint.xml file
+
++
+It is highly recommended to declare a backup
+
+<pin>
element. Not having a second pin defined can cause connection failures when the particular site certificate is rotated and the app has not yet been updated.+
+
+MissingFirebaseInstanceTokenRefresh
+
+Disabled By: Project lint.xml file
+
++
+Apps that use Firebase Cloud Messaging should implement the
+
+FirebaseMessagingService#onNewToken()
callback in order to observe token changes.More info: https://firebase.google.com/docs/cloud-messaging/android/client#monitor-token-generation
+
+
+
+MissingId
+
+Disabled By: Project lint.xml file
+
++
+If you do not specify an
+
+"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
+* Supply the
+
+If you provide neither of the previous two, the system uses the ID of the container view.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+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.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+MissingVersion
+
+Disabled By: Project lint.xml file
+
++
+You should define the version information for your application.
+
+
+
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
++
+
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.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+MonochromeLauncherIcon
+
+Disabled By: Project lint.xml file
+
++
+If
+
+For example, if
+
+android:roundIcon
and android:icon
are both in your manifest, you must either remove the reference to android:roundIcon
if it is not needed; or, supply the monochrome icon in the drawable defined by the android:roundIcon
and android:icon
attribute.+
+For example, if
android:roundIcon
and android:icon
are both in the manifest, a launcher might choose to use android:roundIcon
over android:icon
to display the adaptive app icon. Therefore, your themed application iconwill not show if your monochrome attribute is not also specified in android:roundIcon
.+
+
+MutatingSharedPrefs
+
+Disabled By: Project lint.xml file
+
++
+As stated in the docs for
+
+ "Note that you <em>must not</em> modify the set instance returned by this call. The consistency of the stored data is not guaranteed if you do, nor is your ability to modify the instance at all."
+
+SharedPreferences.getStringSet
, you must not modify the set returned by getStringSet
:+
+ "Note that you <em>must not</em> modify the set instance returned by this call. The consistency of the stored data is not guaranteed if you do, nor is your ability to modify the instance at all."
+
+
+NegativeMargin
+
+Disabled By: Default
+
++
+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.
+
++
+
+NestedScrolling
+
+Disabled By: Project lint.xml file
+
++
+A scrolling widget such as a
+
+ScrollView
should not contain any nested scrolling widgets since this has various usability issues+
+
+NestedWeights
+
+Disabled By: Project lint.xml file
+
++
+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.+
+
+NewerVersionAvailable
+
+Disabled By: Default
+
++
+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
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+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.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+NoHardKeywords
+
+Disabled By: Default
+
++
+Do not use Kotlin’s hard keywords as the name of methods or fields. These require the use of backticks to escape when calling from Kotlin. Soft keywords, modifier keywords, and special identifiers are allowed.
+
+For example, ActionEvent's
+
++
+For example, ActionEvent's
getWhen()
method requires backticks when used from Kotlin:
++val timestamp = event.`when` ++
+
+
+NoOp
+
+Disabled By: Default
+
++
+This check looks for code which looks like it's a no-op -- usually leftover expressions from interactive debugging, but in some cases bugs where you had intended to do something with the expression such as assign it to a field.
+This check can be configured via the following options:
+
+
++This check can be configured via the following options:
+
+pure-getters (default is false):
+Whether to assume methods with getter-names have no side effects.
+
+Getter methods (where names start with
+
+To configure this option, use a `lint.xml` file in the project or source folder using an
+Whether to assume methods with getter-names have no side effects.
+
+Getter methods (where names start with
get
or is
, and have non-void return types, and no arguments) should not have side effects. With this option turned on, lint will assume that is the case and will list any getter calls whose results are ignored as suspicious code.+
+To configure this option, use a `lint.xml` file in the project or source folder using an
<option>
block like the following:
++ 1 <lint> + 2 <issue id="NoOp"> + 3 <option name="pure-getters" value="false" /> + 4 </issue> + 5 </lint> ++
+
+
+NonConstantResourceId
+
+Disabled By: Project lint.xml file
+
++
+Avoid the usage of resource IDs where constant expressions are required.
+
+A future version of the Android Gradle Plugin will generate R classes with non-constant IDs in order to improve the performance of incremental compilation.
+
++
+A future version of the Android Gradle Plugin will generate R classes with non-constant IDs in order to improve the performance of incremental compilation.
+
+
+NonResizeableActivity
+
+Disabled By: Project lint.xml file
+
++
+The
+
+To fix the issue, consider declaring the corresponding activity element with
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+<activity>
element should be allowed to be resized to allow users to take advantage of the multi-window environments available on larger screen Android devices.+
+To fix the issue, consider declaring the corresponding activity element with
resizableActivity="true"
attribute.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+NotConstructor
+
+Disabled By: Project lint.xml file
+
++
+This check catches methods that look like they were intended to be constructors, but aren't.
+
++
+
+NotificationIconCompatibility
+
+Disabled By: Project lint.xml file
+
++
+Notification icons should define a raster image to support Android versions below 5.0 (API 21). Note that the way Lint decides whether an icon is a notification icon is based on the filename prefix
+
+ic_stat_
. This corresponds to the naming convention documented in https://d.android.com/r/studio-ui/designer/material/iconography+
+
+NotifyDataSetChanged
+
+Disabled By: Project lint.xml file
+
++
+The
+
+RecyclerView
adapter's onNotifyDataSetChanged
method does not specify what about the data set has changed, forcing any observers to assume that all existing items and structure may no longer be valid. `LayoutManager`s will be forced to fully rebind and relayout all visible views.+
+
+ObsoleteLayoutParam
+
+Disabled By: Project lint.xml file
+
++
+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.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+ObsoleteSdkInt
+
+Disabled By: Project lint.xml file
+
++
+This check flags version checks that are not necessary, because the
+
+Similarly, it also looks for resources in
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+minSdkVersion
(or surrounding known API level) is already at least as high as the version checked for.+
+Similarly, it also looks for resources in
-vNN
folders, such as values-v14
where the version qualifier is less than or equal to the minSdkVersion
, where the contents should be merged into the best folder.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+OldTargetApi
+
+Disabled By: Project lint.xml file
+
++
+When your application runs on a version of Android that is more recent than your
+
+To fix this issue, set the
+https://developer.android.com/distribute/best-practices/develop/target-sdk.html
+
+
+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: https://developer.android.com/reference/android/os/Build.VERSION_CODES.html as well as follow this guide:+https://developer.android.com/distribute/best-practices/develop/target-sdk.html
More info:
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+OutdatedLibrary
+
+Disabled By: Project lint.xml file
+
++
+Your app is using an outdated version of a library. This may cause violations of Google Play policies (see https://play.google.com/about/monetization-ads/ads/) and/or may affect your app’s visibility on the Play Store.
+
+Please try updating your app with an updated version of this library, or remove it from your app.
+
+
++
+Please try updating your app with an updated version of this library, or remove it from your app.
More info: https://play.google.com/sdks
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+Overdraw
+
+Disabled By: Project lint.xml file
+
++
+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.
+
++
+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.
+
+
+ParcelClassLoader
+
+Disabled By: Project lint.xml file
+
++
+The documentation for
+
+If you are writing your own classes into the
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Parcel#readParcelable(ClassLoader)
(and its variations) says that you can pass in null
to pick up the default class loader. However, that ClassLoader is a system class loader and is not able to find classes in your own application.+
+If you are writing your own classes into the
Parcel
(not just SDK classes like String
and so on), then you should supply a ClassLoader
for your application instead; a simple way to obtain one is to just call getClass().getClassLoader()
from your own class.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+PermissionImpliesUnsupportedHardware
+
+Disabled By: Project lint.xml file
+
++
+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: https://developer.android.com/guide/topics/manifest/uses-feature-element.html#permissions
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+PermissionNamingConvention
+
+Disabled By: Default
+
++
+Permissions should be prefixed with an app's package name, using reverse-domain-style naming. This prefix should be followed by
+
+Following this recommendation avoids naming collisions, and helps clearly identify the owner and intention of a custom permission.
+
+.permission.
, and then a description of the capability that the permission represents, in upper SNAKE_CASE. For example, com.example.myapp.permission.ENGAGE_HYPERSPACE
.+
+Following this recommendation avoids naming collisions, and helps clearly identify the owner and intention of a custom permission.
+
+
+PinSetExpiry
+
+Disabled By: Project lint.xml file
+
++
+Ensures that the
+
+expiration
attribute of the <pin-set>
element is valid and has not already expired or is expiring soon+
+
+PluralsCandidate
+
+Disabled By: Project lint.xml file
+
++
+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: +
+
+(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.
+
++
+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.
+
+
+PrivateApi
+
+Disabled By: Project lint.xml file
+
++
+Using reflection to access hidden/private Android APIs is not safe; it will often not work on devices from other vendors, and it may suddenly stop working (if the API is removed) or crash spectacularly (if the API behavior changes, since there are no guarantees for compatibility).
+
++
+
+PrivateResource
+
+Disabled By: Project lint.xml file
+
++
+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.
+
++
+To fix this, copy the resource into your own project instead.
+
+
+ProguardSplit
+
+Disabled By: Project lint.xml file
+
++
+Earlier versions of the Android tools bundled a single
+
+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
+
+To migrate your project to the new setup, create a new
+
+
+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
+
+
+ProviderReadPermissionOnly
+
+Disabled By: Project lint.xml file
+
++
+This check looks for Content Providers that only have the
+
+If
+
+readPermission
attribute but implement write APIs.+
+If
android:readPermission
is specified and both android:permission
and android:writePermission
are omitted, other apps can access any write operations that this provider exposes with no permission check. For a quick fix, changing the existing android:readPermission
to android:permission
will protect both read and write access with the same permission. Alternatively, declaring a separate android:writePermission
can protect write access with a different permission.+
+
+ProxyPassword
+
+Disabled By: Project lint.xml file
+
++
+Storing proxy server passwords in clear text is dangerous if this file is shared via version control. If this is deliberate or this is a truly private project, suppress this warning.
+
++
+
+PxUsage
+
+Disabled By: Project lint.xml file
+
++
+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
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+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.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+QueryPermissionsNeeded
+
+Disabled By: Project lint.xml file
+
++
+Apps that target Android 11 cannot query or interact with other installed apps by default. If you need to query or interact with other installed apps, you may need to add a
+
+As a corollary, the methods
+
+<queries>
declaration in your manifest.+
+As a corollary, the methods
PackageManager#getInstalledPackages
and PackageManager#getInstalledApplications
will no longer return information about all installed apps. To query specific apps or types of apps, you can use methods like PackageManager#getPackageInfo
or PackageManager#queryIntentActivities
.More info: https://g.co/dev/packagevisibility
+
+
+
+Recycle
+
+Disabled By: Project lint.xml file
+
++
+Many resources, such as TypedArrays, VelocityTrackers, etc., should be recycled (with a
+
+recycle()
call) after use. This lint check looks for missing recycle()
calls.+
+
+RedundantLabel
+
+Disabled By: Project lint.xml file
+
++
+When an activity does not have a label attribute, it will use the one from the application tag. Since the application has already specified the same label, the label on this activity can be omitted.
+
++
+
+RedundantNamespace
+
+Disabled By: Project lint.xml file
+
++
+In Android XML documents, only specify the namespace on the root/document element. Namespace declarations elsewhere in the document are typically accidental leftovers from copy/pasting XML from other files or documentation.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+Registered
+
+Disabled By: Default
+
++
+Activities, services and content providers should be registered in the
+
+If your activity is simply a parent class intended to be subclassed by other "real" activities, make it an abstract class.
+
+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.
+
+
+RelativeOverlap
+
+Disabled By: Project lint.xml file
+
++
+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
.+
+
+ReportShortcutUsage
+
+Disabled By: Project lint.xml file
+
++
+Reporting shortcut usage is important to improving the ranking of shortcuts
+
++
+
+RequiredSize
+
+Disabled By: Default
+
++
+All views must specify an explicit
+
+It's possible to specify these widths via styles as well. GridLayout, as a special case, does not require you to specify a size.
+
+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.
+
+
+RequiresFeature
+
+Disabled By: Project lint.xml file
+
++
+Some APIs require optional features to be present. This check makes sure that calls to these APIs are surrounded by a check which enforces this.
+
++
+
+ResourceAsColor
+
+Disabled By: Project lint.xml file
+
++
+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
+
+Similarly, methods that take a dimension integer should be passed an actual dimension (call
+
+getResources().getColor(resource)
to resolve the actual color value first.+
+Similarly, methods that take a dimension integer should be passed an actual dimension (call
getResources().getDimension(resource)
+
+
+RiskyLibrary
+
+Disabled By: Project lint.xml file
+
++
+Your app is using a version of a library that has been identified by the library developer as a potential source of privacy and/or security risks. This may be a violation of Google Play policies (see https://play.google.com/about/monetization-ads/ads/) and/or affect your app’s visibility on the Play Store.
+
+When available, the individual error messages from lint will include details about the reasons for this advisory.
+
+Please try updating your app with an updated version of this library, or remove it from your app.
+
+
++
+When available, the individual error messages from lint will include details about the reasons for this advisory.
+
+Please try updating your app with an updated version of this library, or remove it from your app.
More info:
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+RtlEnabled
+
+Disabled By: Project lint.xml file
+
++
+To enable right-to-left support, when running on API 17 and higher, you must set the
+
+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.
+
+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.
+
+
+RtlHardcoded
+
+Disabled By: Project lint.xml file
+
++
+Using
+
+For XML attributes such as paddingLeft and
+
+(Note: For
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+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/end attributes. On older platforms, where RTL is not supported and the start/end 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"
.)Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+RtlSymmetry
+
+Disabled By: Project lint.xml file
+
++
+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.
+
++
+
+SQLiteString
+
+Disabled By: Project lint.xml file
+
++
+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.
+
+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
+
+To fix this, you can change your schema to use a
+
++
+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
+
+
+
+SSLCertificateSocketFactoryCreateSocket
+
+Disabled By: Project lint.xml file
+
++
+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()
.+
+
+SSLCertificateSocketFactoryGetInsecure
+
+Disabled By: Project lint.xml file
+
++
+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.+
+
+ScopedStorage
+
+Disabled By: Project lint.xml file
+
++
+Scoped storage is enforced on Android 10+ (or Android 11+ if using
+
+As of Android 13, if you need to query or interact with MediaStore or media files on the shared storage, you should be using instead one or more new storage permissions:
+*
+*
+*
+
+and then add
+
+The
+
+To learn more, read these resources: Play policy: https://goo.gle/policy-storage-help Allowable use cases: https://goo.gle/policy-storage-usecases
+
+requestLegacyExternalStorage
). In particular, WRITE_EXTERNAL_STORAGE
will no longer provide write access to all files; it will provide the equivalent of READ_EXTERNAL_STORAGE
instead.+
+As of Android 13, if you need to query or interact with MediaStore or media files on the shared storage, you should be using instead one or more new storage permissions:
+*
android.permission.READ_MEDIA_IMAGES
+*
android.permission.READ_MEDIA_VIDEO
+*
android.permission.READ_MEDIA_AUDIO
+
+and then add
maxSdkVersion="33"
to the older permission. See the developer guide for how to do this: https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions+
+The
MANAGE_EXTERNAL_STORAGE
permission can be used to manage all files, but it is rarely necessary and most apps on Google Play are not allowed to use it. Most apps should instead migrate to use scoped storage. To modify or delete files, apps should request write access from the user as described at https://goo.gle/android-mediastore-createwriterequest.+
+To learn more, read these resources: Play policy: https://goo.gle/policy-storage-help Allowable use cases: https://goo.gle/policy-storage-usecases
More info: https://goo.gle/android-storage-usecases
+
+
+
+ScrollViewCount
+
+Disabled By: Project lint.xml file
+
++
+A
+
+ScrollView
can only have one child widget. If you want more children, wrap them in a container layout.+
+
+ScrollViewSize
+
+Disabled By: Project lint.xml file
+
++
+ScrollView children must set their
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+layout_width
or layout_height
attributes to wrap_content
rather than fill_parent
or match_parent
in the scrolling dimensionNote: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+SdCardPath
+
+Disabled By: Project lint.xml file
+
++
+Your code should not reference the
+
+Similarly, do 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()
.+
+
+SecureRandom
+
+Disabled By: Project lint.xml file
+
++
+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:
+
+
+SelectableText
+
+Disabled By: Default
+
++
+If a
+
+This lint check looks for TextViews which are likely to be displaying data: views whose text is set dynamically.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+<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.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+SetAndClearCommunicationDevice
+
+Disabled By: Project lint.xml file
+
++
+After selecting the audio device for communication use cases using
+
+setCommunicationDevice(AudioDeviceInfo device)
, the selection is active as long as the requesting application process lives, until clearCommunicationDevice()
is called or until the device is disconnected. It is therefore important to clear the request when a call ends or the requesting activity or service is stopped or destroyed.+
+
+SetJavaScriptEnabled
+
+Disabled By: Project lint.xml file
+
++
+Your code should not invoke
+
+setJavaScriptEnabled
if you are not sure that your app really requires JavaScript support.More info:
+
+
+SetTextI18n
+
+Disabled By: Project lint.xml file
+
++
+When calling
+* Never call
+* 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.
+
+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.
+
+
+SetWorldReadable
+
+Disabled By: Project lint.xml file
+
++
+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: https://goo.gle/SetWorldReadable
+
+
+
+SetWorldWritable
+
+Disabled By: Project lint.xml file
+
++
+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: https://goo.gle/SetWorldWritable
+
+
+
+ShiftFlags
+
+Disabled By: Project lint.xml file
+
++
+When defining multiple constants for use in flags, the recommended style is to use the form
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+1 << 2
, 1 << 3
, 1 << 4
and so on to ensure that the constants are unique and non-overlapping.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+ShortAlarm
+
+Disabled By: Project lint.xml file
+
++
+Frequent alarms are bad for battery life. As of API 22, the
+
+If you really need to do work sooner than 5 seconds, post a delayed message or runnable to a Handler.
+
+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.
+
+
+ShowToast
+
+Disabled By: Project lint.xml file
+
++
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Toast.makeText()
creates a Toast
but does not show it. You must call show()
on the resulting object to actually make the Toast
appear.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+SignatureOrSystemPermissions
+
+Disabled By: Project lint.xml file
+
++
+The
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+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.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+SimpleDateFormat
+
+Disabled By: Project lint.xml file
+
++
+Almost all callers should use
+
+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.
+
+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.
+
+
+Slices
+
+Disabled By: Project lint.xml file
+
++
+This check analyzes usages of the Slices API and offers suggestions based on best practices.
+
++
+
+SmallSp
+
+Disabled By: Project lint.xml file
+
++
+Avoid using sizes smaller than 11sp.
+
++
+
+SourceLockedOrientationActivity
+
+Disabled By: Project lint.xml file
+
++
+The
+
+
+Activity
should not be locked to a portrait orientation so that users can take advantage of the multi-window environments and larger landscape-first screens that Android runs on such as ChromeOS, tablets, and foldables. To fix the issue, consider calling setRequestedOrientation
with the ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR
or ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
options or removing the call all together.More info: https://developer.android.com/guide/topics/large-screens/large-screen-cookbook#restricted_app_orientation
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+SpUsage
+
+Disabled By: Project lint.xml file
+
++
+When setting text sizes, you should normally use
+
+There are cases where you might need to use
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+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.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+SpecifyJobSchedulerIdRange
+
+Disabled By: Project lint.xml file
+
++
+When using
+For more information look at
+
+JobScheduler
APIs directly, WorkManager
requires that developers specify a range of JobScheduler
ids that are safe for WorkManager
to use so the `id`s do not collide. +For more information look at
androidx.work.Configuration.Builder.setJobSchedulerJobIdRange(int, int)
.+
+
+SquareAndRoundTilePreviews
+
+Disabled By: Project lint.xml file
+
++
+Tile projects should specify preview resources for different screen shapes. The preview resource is specified in the manifest under tile service. And you have to make sure they have resources for different screen shapes.
+
++
+
+StateListReachable
+
+Disabled By: Project lint.xml file
+
++
+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.
+
++
+
+StaticFieldLeak
+
+Disabled By: Project lint.xml file
+
++
+A static field will leak contexts.
+
+Non-static inner classes have an implicit reference to their outer class. If that outer class is for example a
+
+Similarly, direct field references to activities and fragments from these longer running instances can cause leaks.
+
+ViewModel classes should never point to Views or non-application Contexts.
+
++
+Non-static inner classes have an implicit reference to their outer class. If that outer class is for example a
Fragment
or Activity
, then this reference means that the long-running handler/loader/task will hold a reference to the activity which prevents it from getting garbage collected.+
+Similarly, direct field references to activities and fragments from these longer running instances can cause leaks.
+
+ViewModel classes should never point to Views or non-application Contexts.
+
+
+StopShip
+
+Disabled By: Default
+
++
+Using the comment
+
+In Kotlin, the
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+// 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. In Gradle projects, this is only checked for non-debug (release) builds.+
+In Kotlin, the
TODO()
method is also treated as a stop ship marker; you can use it to make incomplete code compile, but it will throw an exception at runtime and therefore should be fixed before shipping releases.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+StringFormatCount
+
+Disabled By: Project lint.xml file
+
++
+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.
+
++
+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.
+
+
+StringFormatInTimber
+
+Disabled By: Project lint.xml file
+
++
+Since Timber handles String.format automatically, you may not use String#format().
+
++
+
+StringFormatTrivial
+
+Disabled By: Default
+
++
+Every call to
+
+String.format
creates a new Formatter
instance, which will decrease the performance of your app. String.format
should only be used when necessary--if the formatted string contains only trivial conversions (e.g. b
, s
, c
) and there are no translation concerns, it will be more efficient to replace them and concatenate with +
.+
+
+SuspiciousImport
+
+Disabled By: Project lint.xml file
+
++
+Importing
+
+Once the import is there you might get a lot of "confusing" error messages because of course the fields available on
+
+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.+
+
+SwitchIntDef
+
+Disabled By: Project lint.xml file
+
++
+This check warns if a
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+switch
statement does not explicitly include all the values declared by the typedef @IntDef
declaration.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+SyntheticAccessor
+
+Disabled By: Default
+
++
+A private inner class which is accessed from the outer class will force the compiler to insert a synthetic accessor; this means that you are causing extra overhead. This is not important in small projects, but is important for large apps running up against the 64K method handle limit, and especially for libraries where you want to make sure your library is as small as possible for the cases where your library is used in an app running up against the 64K limit.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+SystemPermissionTypo
+
+Disabled By: Project lint.xml file
+
++
+This check looks for required permissions that look like well-known system permissions or permissions from the Android SDK, but aren't, and may be typos.
+
+Please double check the permission value you have supplied.
+
++
+Please double check the permission value you have supplied.
+
+
+TextFields
+
+Disabled By: Project lint.xml file
+
++
+Providing an
+
+The lint detector also looks at the
+
+If you really want to keep the text field generic, you can suppress this warning by setting
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+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). +
+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"
.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+ThrowableNotAtBeginning
+
+Disabled By: Project lint.xml file
+
++
+In Timber you have to pass a Throwable at the beginning of the call.
+
++
+
+TileProviderPermissions
+
+Disabled By: Project lint.xml file
+
++
+TileProviders should require the
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+com.google.android.wearable.permission.BIND_TILE_PROVIDER
permission to prevent arbitrary apps from binding to it.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+TimberExceptionLogging
+
+Disabled By: Project lint.xml file
+
++
+Explicitly including the exception message is redundant when supplying an exception to log.
+
++
+
+TooDeepLayout
+
+Disabled By: Project lint.xml file
+
++
+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
.+
+
+TooManyViews
+
+Disabled By: Project lint.xml file
+
++
+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
+
++
+The maximum view count defaults to 80 but can be configured with the environment variable
ANDROID_LINT_MAX_VIEW_COUNT
.+
+
+TranslucentOrientation
+
+Disabled By: Project lint.xml file
+
++
+Specifying a fixed screen orientation with a translucent theme isn't supported on apps with
+
+For example, your activity requests landscape and the visible activity behind your translucent activity request portrait. In this case the system can only honor one of the requests and currently prefers to honor the request from non-translucent activities since there is nothing visible behind them.
+
+Devices running platform version O or greater will throw an exception in your app if this state is detected.
+
+targetSdkVersion
O or greater since there can be an another activity visible behind your activity with a conflicting request.+
+For example, your activity requests landscape and the visible activity behind your translucent activity request portrait. In this case the system can only honor one of the requests and currently prefers to honor the request from non-translucent activities since there is nothing visible behind them.
+
+Devices running platform version O or greater will throw an exception in your app if this state is detected.
+
+
+TrulyRandom
+
+Disabled By: Project lint.xml file
+
++
+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.
+
++
+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:
+
+
+TrustAllX509TrustManager
+
+Disabled By: Project lint.xml file
+
++
+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: https://goo.gle/TrustAllX509TrustManager
+
+
+
+TypographyDashes
+
+Disabled By: Project lint.xml file
+
++
+The "n dash" (u2013, –) and the "m dash" (u2014, —) 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: https://en.wikipedia.org/wiki/Dash
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+TypographyEllipsis
+
+Disabled By: Project lint.xml file
+
++
+You can replace the string "..." with a dedicated ellipsis character, ellipsis character (u2026, …). This can help make the text more readable.
+
+
+More info: https://en.wikipedia.org/wiki/Ellipsis
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+TypographyFractions
+
+Disabled By: Command line flag
+
++
+You can replace certain strings, such as 1/2, and 1/4, with dedicated characters for these, such as ½ (½) and ¼ (¼). This can help make the text more readable.
+
+
+More info: https://en.wikipedia.org/wiki/Number_Forms
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+TypographyOther
+
+Disabled By: Project lint.xml file
+
++
+This check looks for miscellaneous typographical problems and offers replacement sequences that will make the text easier to read and your application more polished.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+TypographyQuotes
+
+Disabled By: Command line flag
+
++
+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: https://en.wikipedia.org/wiki/Quotation_mark
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+Typos
+
+Disabled By: Project lint.xml file
+
++
+This check looks through the string definitions, and if it finds any words that look like likely misspellings, they are flagged.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+UastImplementation
+
+Disabled By: Project lint.xml file
+
++
+Use UAST interface whenever possible, and do not rely on UAST implementation, which is subject to change. If language-specific information is needed, the next option is to use PSI directly (though these APIs are less stable and can depend on compiler internals, especially in the case of Kotlin).
+
++
+
+UnknownIdInLayout
+
+Disabled By: Project lint.xml file
+
++
+The
+
+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.
+
+@+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.
+
+
+UnknownNullness
+
+Disabled By: Default
+
++
+To improve referencing this code from Kotlin, consider adding explicit nullness information here with either
+This check can be configured via the following options:
+
+
+
+@NonNull
or @Nullable
.+This check can be configured via the following options:
+
+ignore-deprecated (default is false):
+Whether to ignore classes and members that have been annotated with
+
+Normally this lint check will flag all unannotated elements, but by setting this option to
+
+To configure this option, use a `lint.xml` file in the project or source folder using an
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+Whether to ignore classes and members that have been annotated with
@Deprecated
.+
+Normally this lint check will flag all unannotated elements, but by setting this option to
true
it will skip any deprecated elements.+
+To configure this option, use a `lint.xml` file in the project or source folder using an
<option>
block like the following:
++ 1 <lint> + 2 <issue id="UnknownNullness"> + 3 <option name="ignore-deprecated" value="false" /> + 4 </issue> + 5 </lint> ++
+
+
+
+UnlocalizedSms
+
+Disabled By: Project lint.xml file
+
++
+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.
+
++
+
+UnprotectedSMSBroadcastReceiver
+
+Disabled By: Project lint.xml file
+
++
+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: https://goo.gle/UnprotectedSMSBroadcastReceiver
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+UnsafeDynamicallyLoadedCode
+
+Disabled By: Project lint.xml file
+
++
+Dynamically loading code from locations other than the application's library directory or the Android platform's built-in library directories is dangerous, as there is an increased risk that the code could have been tampered with. Applications should use
+
+loadLibrary
when possible, which provides increased assurance that libraries are loaded from one of these safer locations. Application developers should use the features of their development environment to place application native libraries into the lib directory of their compiled APKs.+
+
+UnsafeIntentLaunch
+
+Disabled By: Project lint.xml file
+
++
+Intent that potentially could come from an untrusted source should not be launched from an unprotected component without first being sanitized. See this support FAQ for details: https://support.google.com/faqs/answer/9267555
+
++
+
+UnsafeNativeCodeLocation
+
+Disabled By: Project lint.xml file
+
++
+In general, application native code should only be placed in the application's library directory, not in other locations such as the res or assets directories. Placing the code in the library directory provides increased assurance that the code will not be tampered with after application installation. Application developers should use the features of their development environment to place application native libraries into the lib directory of their compiled APKs. Embedding non-shared library native executables into applications should be avoided when possible.
+
++
+
+UnsafeOptInUsageWarning
+
+Disabled By: Project lint.xml file
+
++
+This API has been flagged as opt-in with warning-level severity.
+
+Any declaration annotated with this marker is considered part of an unstable or
+otherwise non-standard API surface and its call sites should accept the opt-in
+aspect of it by using the
+effectively causing further propagation of the opt-in aspect -- or configuring
+the
+
+To configure project-wide opt-in, specify the
+as a comma-delimited list of opted-in annotations:
+ +
+
++
+Any declaration annotated with this marker is considered part of an unstable or
+otherwise non-standard API surface and its call sites should accept the opt-in
+aspect of it by using the
@OptIn
annotation, using the marker annotation --+effectively causing further propagation of the opt-in aspect -- or configuring
+the
UnsafeOptInUsageWarning
check's options for project-wide opt-in.+
+To configure project-wide opt-in, specify the
opt-in
option value in lint.xml
+as a comma-delimited list of opted-in annotations:
+ +
+<lint> + <issue id="UnsafeOptInUsageWarning"> + <option name="opt-in" value="com.foo.ExperimentalBarAnnotation" /> + </issue> +</lint> ++
+
+
+UnsafeProtectedBroadcastReceiver
+
+Disabled By: Project lint.xml file
+
++
+`BroadcastReceiver`s 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: https://goo.gle/UnsafeProtectedBroadcastReceiver
+
+
+
+UnsupportedChromeOsCameraSystemFeature
+
+Disabled By: Project lint.xml file
+
++
+You should look for the
+
+
+FEATURE_CAMERA_ANY
features to include all possible cameras that may be on the device. Looking for FEATURE_CAMERA
only looks for a rear facing camera, which certain large screen devices don't have, as well as newer device configurations and modes may place the device in a state where the rear camera is not available. To fix the issue, look for FEATURE_CAMERA_ANY
instead.More info: https://developer.android.com/guide/topics/large-screens/large-screen-cookbook#chromebook_camera_support
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+UnsupportedChromeOsHardware
+
+Disabled By: Default
+
++
+The
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+<uses-feature>
element should not require this unsupported large screen 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 ChromeOS, large screen, or foldable device are reviewed and marked as not required in the manifest.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+Untranslatable
+
+Disabled By: Project lint.xml file
+
++
+Strings can be marked with
+
+There are cases where translators accidentally translate these strings anyway, and lint will flag these occurrences with this lint check.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+translatable=false
to indicate that they are not intended to be translated, but are present in the resource file for other purposes (for example for non-display strings that should vary by some other configuration qualifier such as screen size or API level).+
+There are cases where translators accidentally translate these strings anyway, and lint will flag these occurrences with this lint check.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+UnusedAttribute
+
+Disabled By: Project lint.xml file
+
++
+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
+
+This is not an error; the application will simply ignore the attribute. However, if the attribute is important to the appearance or 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
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+minSdkVersion
attribute).+
+This is not an error; the application will simply ignore the attribute. However, if the attribute is important to the appearance or 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.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+UnusedIds
+
+Disabled By: Default
+
++
+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.
+
+
+The unused resource check can ignore tests. If you want to include resources that are only referenced from tests, consider packaging them in a test source set instead.
+
+You can include test sources in the unused resource check by setting the system property lint.unused-resources.include-tests =true, and to exclude them (usually for performance reasons), use lint.unused-resources.exclude-tests =true.
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
++
+
+The unused resource check can ignore tests. If you want to include resources that are only referenced from tests, consider packaging them in a test source set instead.
+
+You can include test sources in the unused resource check by setting the system property lint.unused-resources.include-tests =true, and to exclude them (usually for performance reasons), use lint.unused-resources.exclude-tests =true.
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+UnusedNamespace
+
+Disabled By: Project lint.xml file
+
++
+Unused namespace declarations take up space and require processing that is not necessary
+
++
+
+UnusedQuantity
+
+Disabled By: Project lint.xml file
+
++
+Android defines a number of different quantity strings, such as
+
+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
+
+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
.+
+
+UnusedResources
+
+Disabled By: Project lint.xml file
+
++
+Unused resources make applications larger and slow down builds.
+
+
+The unused resource check can ignore tests. If you want to include resources that are only referenced from tests, consider packaging them in a test source set instead.
+
+You can include test sources in the unused resource check by setting the system property lint.unused-resources.include-tests =true, and to exclude them (usually for performance reasons), use lint.unused-resources.exclude-tests =true.
+,
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
++
+
+The unused resource check can ignore tests. If you want to include resources that are only referenced from tests, consider packaging them in a test source set instead.
+
+You can include test sources in the unused resource check by setting the system property lint.unused-resources.include-tests =true, and to exclude them (usually for performance reasons), use lint.unused-resources.exclude-tests =true.
+,
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+UnusedTranslation
+
+Disabled By: Project lint.xml file
+
++
+If an application defines a translation for a language which is not included in the app's
+
+localeConfig
file (when declared in the manifest), that language will be "unused"; it will not be presented to the user. Usually this means you have forgotten to include it in the locale config file.+
+
+UsableSpace
+
+Disabled By: Project lint.xml file
+
++
+When you need to allocate disk space for large files, consider using the new
+
+When deciding if the device has enough disk space to hold your new data, call
+
+Note that these methods require API level 26. If your app is running on older devices, you will probably need to use both APIs, conditionally switching on
+
+allocateBytes(FileDescriptor, long)
API, which will automatically clear cached files belonging to other apps (as needed) to meet your request.+
+When deciding if the device has enough disk space to hold your new data, call
getAllocatableBytes(UUID)
instead of using getUsableSpace()
, since the former will consider any cached data that the system is willing to clear on your behalf.+
+Note that these methods require API level 26. If your app is running on older devices, you will probably need to use both APIs, conditionally switching on
Build.VERSION.SDK_INT
. Lint only looks in the same compilation unit to see if you are already using both APIs, so if it warns even though you are already using the new API, consider moving the calls to the same file or suppressing the warning.+
+
+UseAlpha2
+
+Disabled By: Project lint.xml file
+
++
+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
+
+
+
+UseCheckPermission
+
+Disabled By: Project lint.xml file
+
++
+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
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Context#checkCallingPermission
it should call Context#enforceCallingPermission
.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+UseCompatLoadingForColorStateLists
+
+Disabled By: Project lint.xml file
+
++
+Use Compat loading of color state lists
+
++
+
+UseCompatLoadingForDrawables
+
+Disabled By: Project lint.xml file
+
++
+Use Compat loading of drawables
+
++
+
+UseCompatTextViewDrawableApis
+
+Disabled By: Project lint.xml file
+
++
+Use Compat loading of compound text view drawables
+
++
+
+UseCompatTextViewDrawableXml
+
+Disabled By: Project lint.xml file
+
++
+
+
+TextView
uses android:
compound drawable attributes instead of app:
ones+
+
+UseCompoundDrawables
+
+Disabled By: Project lint.xml file
+
++
+A
+
+If the two widgets are offset from each other with margins, this can be replaced with a
+
+There's a lint quickfix to perform this conversion in the Eclipse plugin.
+
+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.
+
+
+UseGetLayoutInflater
+
+Disabled By: Project lint.xml file
+
++
+Using LayoutInflater.from(Context) can return a LayoutInflater that does not have the correct theme.
+
++
+
+UseOfBundledGooglePlayServices
+
+Disabled By: Project lint.xml file
+
++
+Google Play services SDK's can be selectively included, which enables a smaller APK size. Consider declaring dependencies on individual Google Play services SDK's. If you are using Firebase API's (https://firebase.google.com/docs/android/setup), Android Studio's Tools → Firebase assistant window can automatically add just the dependencies needed for each feature.
+
++
+
+UseSparseArrays
+
+Disabled By: Project lint.xml file
+
++
+For maps where the keys are of type integer, it's typically more efficient to use the Android
+
+This is particularly useful when the value types are primitives like ints, where you can use
+
+If you need to construct a
+
+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.+
+
+UseSupportActionBar
+
+Disabled By: Project lint.xml file
+
++
+Use
+
+AppCompatActivity.setSupportActionBar
+
+
+UseSwitchCompatOrMaterialCode
+
+Disabled By: Project lint.xml file
+
++
+Use
+
+SwitchCompat
from AppCompat or SwitchMaterial
from Material library+
+
+UseSwitchCompatOrMaterialXml
+
+Disabled By: Project lint.xml file
+
++
+Use
+
+SwitchCompat
from AppCompat or SwitchMaterial
from Material library+
+
+UseTomlInstead
+
+Disabled By: Project lint.xml file
+
++
+If your project is using a
+
+libs.versions.toml
file, you should place all Gradle dependencies in the TOML file. This lint check looks for version declarations outside of the TOML file and suggests moving them (and in the IDE, provides a quickfix to performing the operation automatically).+
+
+UseValueOf
+
+Disabled By: Project lint.xml file
+
++
+You should not call the constructor for wrapper classes directly, such as`new Integer(42)`. Instead, call the
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+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.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+UselessLeaf
+
+Disabled By: Project lint.xml file
+
++
+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.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+UselessParent
+
+Disabled By: Project lint.xml file
+
++
+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.
+
++
+
+UsingHttp
+
+Disabled By: Project lint.xml file
+
++
+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: https://goo.gle/UsingHttp
+
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.+
+
+
+UsingOnClickInXml
+
+Disabled By: Project lint.xml file
+
++
+Old versions of the platform do not properly support resolving
+
+android:onClick
+
+
+ValidActionsXml
+
+Disabled By: Default
+
++
+Ensures that an actions XML file is properly formed
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+VectorPath
+
+Disabled By: Project lint.xml file
+
++
+Using long vector paths is bad for performance. There are several ways to make the
+* Using less precision
+* Removing some minor details
+* Using the Android Studio vector conversion tool
+* Rasterizing the image (converting to PNG)
+
+pathData
shorter:+* Using less precision
+* Removing some minor details
+* Using the Android Studio vector conversion tool
+* Rasterizing the image (converting to PNG)
+
+
+VectorRaster
+
+Disabled By: Project lint.xml file
+
++
+Vector icons require API 21 or API 24 depending on used features, but when
+
+However, there are some limitations to this raster 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.
+
+minSdkVersion
is less than 21 or 24 and Android Gradle plugin 1.4 or higher is used, a vector drawable placed in the drawable
folder is automatically moved to drawable-anydpi-v21
or drawable-anydpi-v24
and bitmap images are generated for different screen resolutions for backwards compatibility.+
+However, there are some limitations to this raster 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.
+
+
+ViewConstructor
+
+Disabled By: Project lint.xml file
+
++
+Some layout tools (such as the Android layout editor) need to find a constructor with one of the following signatures:
+*
+*
+*
+
+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(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.+
+
+ViewHolder
+
+Disabled By: Project lint.xml file
+
++
+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.+
+
+VisibleForTests
+
+Disabled By: Project lint.xml file
+
++
+With the
+
+This check looks for accesses from production code (e.g. not tests) where the access would not have been allowed with the intended production visibility.
+
+@VisibleForTesting
annotation you can specify an otherwise=
attribute which specifies the intended visibility if the method had not been made more widely visible for the tests.+
+This check looks for accesses from production code (e.g. not tests) where the access would not have been allowed with the intended production visibility.
+
+
+VulnerableCordovaVersion
+
+Disabled By: Default
+
++
+The version of Cordova used in the app is vulnerable to security issues. Please update to the latest Apache Cordova version.
+
++
+
+WakelockTimeout
+
+Disabled By: Project lint.xml file
+
++
+Wakelocks have two acquire methods: one with a timeout, and one without. You should generally always use the one with a timeout. A typical timeout is 10 minutes. If the task takes longer than it is critical that it happens (i.e. can't use
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+JobScheduler
) then maybe they should consider a foreground service instead (which is a stronger run guarantee and lets the user know something long/important is happening).Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+WatchFaceEditor
+
+Disabled By: Project lint.xml file
+
++
+Watch face editor activities must be able to launch in the Wear OS companion app activity task in order to work correctly. Thus only
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+launchMode="standard"
is allowed. The watch face will not be shown on the watch if it does not satisfy this requirement.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+WatchFaceForAndroidX
+
+Disabled By: Project lint.xml file
+
++
+If the package depends on
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+androidx.wear:wear-watchface
, and an AndroidX watch face declares the wearableConfigurationAction
metadata, its value should be androidx.wear.watchface.editor.action.WATCH_FACE_EDITOR
.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+WearBackNavigation
+
+Disabled By: Project lint.xml file
+
++
+Disabling swipe-to-dismiss is generally not recommended for Wear applications because the user expects to dismiss any screen with a swipe. If your activity does not require swipe-to-dismiss to be disabled, the recommendation is to remove the
+
+android:windowSwipeToDismiss
attribute from your theme declaration.+
+
+WearRecents
+
+Disabled By: Project lint.xml file
+
++
+In recents, correctly represent your app's activities, consistent with device implementation.
+
++
+
+WearSplashScreen
+
+Disabled By: Project lint.xml file
+
++
+If your app implements a custom splash screen or uses a launcher theme, migrate your app to the
+
+SplashScreen
library, available in Jetpack, to ensure it displays correctly on all Wear OS versions. Starting in Android 12, the system always applies the new Android system default splash screen on cold and warm starts for all apps. By default, this system default splash screen is constructed using your app’s launcher icon element and the windowBackground
of your theme (if it's a single color). If you do not migrate your app, your app launch experience on Android 12 and higher will be either degraded or may have unintended results.+
+
+WearableActionDuplicate
+
+Disabled By: Project lint.xml file
+
++
+If and only if a watch face service defines
+
+wearableConfigurationAction
metadata, with the value WATCH_FACE_EDITOR
, there should be an activity in the same package, which has an intent filter for WATCH_FACE_EDITOR
(with com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION if minSdkVersion is less than 30).+
+
+WearableConfigurationAction
+
+Disabled By: Project lint.xml file
+
++
+Only when a watch face service defines
+
+wearableConfigurationAction
metadata, with the value WATCH_FACE_EDITOR
, there should be an activity in the same package, which has an intent filter for WATCH_FACE_EDITOR
(with com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION
if minSdkVersion
is less than 30).+
+
+WebViewApiAvailability
+
+Disabled By: Project lint.xml file
+
++
+The
+
+androidx.webkit
library is a static library you can add to your Android application allowing you to use new APIs on older platform versions, targeting more devices.+
+
+WebViewClientOnReceivedSslError
+
+Disabled By: Project lint.xml file
+
++
+This check looks for
+
+onReceivedSslError
implementations that invoke SslErrorHandler#proceed
.More info: https://goo.gle/WebViewClientOnReceivedSslError
+
+
+
+WeekBasedYear
+
+Disabled By: Project lint.xml file
+
++
+The
+
+If you expected this to format as 2019, you should use the pattern
+
+DateTimeFormatter
pattern YYYY
returns the week based year, not the era-based year. This means that 12/29/2019 will format to 2019, but 12/30/2019 will format to 2020!+
+If you expected this to format as 2019, you should use the pattern
yyyy
instead.More info: https://stackoverflow.com/questions/46847245/using-datetimeformatter-on-january-first-cause-an-invalid-year-value
+
+
+
+WifiManagerPotentialLeak
+
+Disabled By: Project lint.xml file
+
++
+On versions prior to Android N (24), initializing the
+
+In many cases, it's not obvious from the code where the
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+WifiManager
via Context#getSystemService
can cause a memory leak if the context is not the application context.+
+In many cases, it's not obvious from the code where the
Context
is coming from (e.g. it might be a parameter to a method, or a field initialized from various method calls). It's possible that the context being passed in is the application context, but to be on the safe side, you should consider changing context.getSystemService(...)
to context.getApplicationContext().getSystemService(...)
.Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
+
+
+
+WorldReadableFiles
+
+Disabled By: Project lint.xml file
+
++
+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: https://goo.gle/WorldReadableFiles
+
+
+
+WorldWriteableFiles
+
+Disabled By: Project lint.xml file
+
++
+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: https://goo.gle/WorldWriteableFiles
+
+
+
+WrongRegion
+
+Disabled By: Project lint.xml file
+
++
+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
+
+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.
+
+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.
+
+
+WrongThreadInterprocedural
+
+Disabled By: Default
+
++
+Searches for interprocedural call paths that violate thread annotations in the program. Tracks the flow of instantiated types and lambda expressions to increase accuracy across method boundaries.
+
++
+
+
+
+
+
+ Suppressing Warnings and Errors
+
+Lint errors can be suppressed in a variety of ways:
+
+1. With a
+2. With a
+3. With a //noinspection comment in the source code
+4. With ignore flags specified in the
+5. With a
+6. With a
+7. With the --ignore flag passed to lint.
+
+To suppress a lint warning with an annotation, add a
+
+To suppress a lint warning with a comment, add a
+
+To suppress a lint warning in an XML file, add a
+
+
+To suppress a lint warning in a
+ +
+Here we specify a comma separated list of issue id's after the disable command. You can also use
+
+To suppress lint warnings with a configuration XML file, create a file named
+
+The format of the
+ +
+To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
+
+
+For more information, see https://developer.android.com/studio/write/lint.html#config
+ +
+ +
+1. With a
@SuppressLint
annotation in the Java code+2. With a
tools:ignore
attribute in the XML file+3. With a //noinspection comment in the source code
+4. With ignore flags specified in the
build.gradle
file, as explained below+5. With a
lint.xml
configuration file in the project+6. With a
lint.xml
configuration file passed to lint via the --config flag+7. With the --ignore flag passed to lint.
+
+To suppress a lint warning with an annotation, add a
@SuppressLint("id")
annotation on the class, method or variable declaration closest to the warning instance you want to disable. The id can be one or more issue id's, such as "UnusedResources"
or {"UnusedResources","UnusedIds"}
, or it can be "all"
to suppress all lint warnings in the given scope.+
+To suppress a lint warning with a comment, add a
//noinspection id
comment on the line before the statement with the error.+
+To suppress a lint warning in an XML file, add a
tools:ignore="id"
attribute on the element containing the error, or one of its surrounding elements. You also need to define the namespace for the tools prefix on the root element in your document, next to the xmlns:android
declaration:+
xmlns:tools="http://schemas.android.com/tools"
+
+To suppress a lint warning in a
build.gradle
file, add a section like this:+ +
+android { + lintOptions { + disable 'TypographyFractions','TypographyQuotes' + } +} ++
+Here we specify a comma separated list of issue id's after the disable command. You can also use
warning
or error
instead of disable
to change the severity of issues.+
+To suppress lint warnings with a configuration XML file, create a file named
lint.xml
and place it at the root directory of the module in which it applies.+
+The format of the
lint.xml
file is something like the following:+ +
+<?xml version="1.0" encoding="UTF-8"?> +<lint> + <!-- Ignore everything in the test source set --> + <issue id="all"> + <ignore path="\*/test/\*" /> + </issue> + + <!-- Disable this given check in this project --> + <issue id="IconMissingDensityFolder" severity="ignore" /> + + <!-- Ignore the ObsoleteLayoutParam issue in the given files --> + <issue id="ObsoleteLayoutParam"> + <ignore path="res/layout/activation.xml" /> + <ignore path="res/layout-xlarge/activation.xml" /> + <ignore regexp="(foo|bar)\.java" /> + </issue> + + <!-- Ignore the UselessLeaf issue in the given file --> + <issue id="UselessLeaf"> + <ignore path="res/layout/main.xml" /> + </issue> + + <!-- Change the severity of hardcoded strings to "error" --> + <issue id="HardcodedText" severity="error" /> +</lint> ++
+To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
+
$ lint --ignore UnusedResources,UselessLeaf /my/project/path
+
+For more information, see https://developer.android.com/studio/write/lint.html#config
+ +