Issue Types

## Overview

| Correctness
2 | error GradleCompatible: Incompatible Gradle Versions
1 | warning DefaultLocale: Implied default locale in case conversion
3 | warning SimpleDateFormat: Implied locale in date format
4 | warning GradleDependency: Obsolete Gradle Dependency
2 | warning GradleDynamicVersion: Gradle Dynamic Version
| Security
1 | warning SetWorldReadable: `File.setReadable()` used to make file world-readable
1 | warning SetWorldWritable: `File.setWritable()` used to make file world-writable
| Performance
5 | warning ObsoleteSdkInt: Obsolete SDK_INT Version Check
2 | warning StaticFieldLeak: Static Field Leaks
2 | warning UseSparseArrays: HashMap can be replaced with SparseArray
| Usability
3 | warning ViewConstructor: Missing View constructors for XML inflation
| Accessibility
1 | warning ClickableViewAccessibility: Accessibility in Custom Views
| Disabled Checks (23)

## Incompatible Gradle Versions

../../build.gradle: All gms/firebase libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 15.0.2, 15.0.1. Examples include `com.google.android.gms:play-services-vision-common:15.0.2` and `com.google.android.gms:play-services-base:15.0.1`
../../build.gradle:54: All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.1.0, 26.1.0. Examples include `com.android.support:exifinterface:27.1.0` and `com.android.support:animated-vector-drawable:26.1.0`

     51   implementation "com.google.zxing:core:3.3.0"
     52   implementation "com.drewnoakes:metadata-extractor:2.9.1"
     53   implementation "com.google.android.gms:play-services-vision:${safeExtGet('googlePlayServicesVersion', '15.0.2')}"
     54   implementation "com.android.support:exifinterface:${safeExtGet('supportLibVersion', '27.1.0')}"
     55   implementation "com.android.support:support-annotations:${safeExtGet('supportLibVersion', '27.1.0')}"
     56   implementation "com.android.support:support-v4:${safeExtGet('supportLibVersion', '27.1.0')}"
     57 }

There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your `targetSdkVersion`.)
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "GradleCompatible" as explained in the Suppressing Warnings and Errors section.
GradleCompatible Correctness Fatal Priority 8/10

## Implied default locale in case conversion

../../src/main/java/com/lwansbrough/RCTCamera/RCTCameraViewManager.java:54: Implicitly using the default locale is a common source of bugs: Use `String.format(Locale, ...)` instead

      51           }
      52           default:
      53               throw new IllegalArgumentException(
      54                       String.format("Unsupported command %d received by %s.", commandType, getClass().getSimpleName()));
      55       }
      56   }

Calling `String#toLowerCase()` or `#toUpperCase()` without specifying an explicit locale is a common source of bugs. The reason for that is that those methods will use the current locale on the user's device, and even though the code appears to work correctly when you are developing the app, it will fail in some locales. For example, in the Turkish locale, the uppercase replacement for `i` is not `I`.
If you want the methods to just perform ASCII replacement, for example to convert an enum name, call `String#toUpperCase(Locale.US)` instead. If you really want to use the current locale, call `String#toUpperCase(Locale.getDefault())` instead.
More info: http://developer.android.com/reference/java/util/Locale.html#default_locale
To suppress this error, use the issue id "DefaultLocale" as explained in the Suppressing Warnings and Errors section.
DefaultLocale Correctness Warning Priority 6/10

## Implied locale in date format

../../src/main/java/com/lwansbrough/RCTCamera/RCTCameraModule.java:777: To get local formatting use `getDateInstance()`, `getDateTimeInstance()`, or `getTimeInstance()`, or use `new SimpleDateFormat(String template, Locale locale)` with for example `Locale.US` for ASCII dates.

     774   }
     775
     776   // Create a media file name
     777   String fileName = String.format("%s", new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()));
     778
     779   if (type == MEDIA_TYPE_IMAGE) {
     780       fileName = String.format("IMG_%s.jpg", fileName);

../../src/main/java/com/lwansbrough/RCTCamera/RCTCameraModule.java:793: To get local formatting use `getDateInstance()`, `getDateTimeInstance()`, or `getTimeInstance()`, or use `new SimpleDateFormat(String template, Locale locale)` with for example `Locale.US` for ASCII dates.

     790
     791     private File getTempMediaFile(int type) {
     792         try {
     793             String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
     794             File outputDir = _reactContext.getCacheDir();
     795             File outputFile;

../../src/main/java/org/reactnative/camera/RNCameraViewHelper.java:356: To get local formatting use `getDateInstance()`, `getDateTimeInstance()`, or `getTimeInstance()`, or use `new SimpleDateFormat(String template, Locale locale)` with for example `Locale.US` for ASCII dates.

     353   textPaint.setColor(Color.YELLOW);
     354   textPaint.setTextSize(35);
     355   Calendar calendar = Calendar.getInstance();
     356   SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd G '->' HH:mm:ss z");
     357   canvas.drawText(simpleDateFormat.format(calendar.getTime()), width * 0.1f, height * 0.2f, textPaint);
     358   canvas.drawText(simpleDateFormat.format(calendar.getTime()), width * 0.2f, height * 0.4f, textPaint);
     359   canvas.drawText(simpleDateFormat.format(calendar.getTime()), width * 0.3f, height * 0.6f, textPaint);

Almost all callers should use `getDateInstance()`, `getDateTimeInstance()`, or `getTimeInstance()` to get a ready-made instance of SimpleDateFormat suitable for the user's locale. The main reason you'd create an instance this class directly is because you need to format/parse a specific machine-readable format, in which case you almost certainly want to explicitly ask for US to ensure that you get ASCII digits (rather than, say, Arabic digits).
Therefore, you should either use the form of the SimpleDateFormat constructor where you pass in an explicit locale, such as Locale.US, or use one of the get instance methods, or suppress this error if really know what you are doing.
More info: http://developer.android.com/reference/java/text/SimpleDateFormat.html
To suppress this error, use the issue id "SimpleDateFormat" as explained in the Suppressing Warnings and Errors section.
SimpleDateFormat Correctness Warning Priority 6/10

## Obsolete Gradle Dependency

../../build.gradle:15: A newer version of com.android.tools.build:gradle than 3.0.1 is available: 3.2.1

     12   }
     13
     14   dependencies {
     15     classpath 'com.android.tools.build:gradle:3.0.1'
     16   }
     17 }

../../build.gradle:53: A newer version of com.google.android.gms:play-services-vision than 15.0.2 is available: 17.0.2

     50   compileOnly 'com.facebook.infer.annotation:infer-annotation:+'
     51   implementation "com.google.zxing:core:3.3.0"
     52   implementation "com.drewnoakes:metadata-extractor:2.9.1"
     53   implementation "com.google.android.gms:play-services-vision:${safeExtGet('googlePlayServicesVersion', '15.0.2')}"
     54   implementation "com.android.support:exifinterface:${safeExtGet('supportLibVersion', '27.1.0')}"
     55   implementation "com.android.support:support-annotations:${safeExtGet('supportLibVersion', '27.1.0')}"
     56   implementation "com.android.support:support-v4:${safeExtGet('supportLibVersion', '27.1.0')}"

../../build.gradle:54: A newer version of com.android.support:exifinterface than 27.1.0 is available: 28.0.0

     51   implementation "com.google.zxing:core:3.3.0"
     52   implementation "com.drewnoakes:metadata-extractor:2.9.1"
     53   implementation "com.google.android.gms:play-services-vision:${safeExtGet('googlePlayServicesVersion', '15.0.2')}"
     54   implementation "com.android.support:exifinterface:${safeExtGet('supportLibVersion', '27.1.0')}"
     55   implementation "com.android.support:support-annotations:${safeExtGet('supportLibVersion', '27.1.0')}"
     56   implementation "com.android.support:support-v4:${safeExtGet('supportLibVersion', '27.1.0')}"
     57 }

../../build.gradle:56: A newer version of com.android.support:support-v4 than 27.1.0 is available: 28.0.0

     53   implementation "com.google.android.gms:play-services-vision:${safeExtGet('googlePlayServicesVersion', '15.0.2')}"
     54   implementation "com.android.support:exifinterface:${safeExtGet('supportLibVersion', '27.1.0')}"
     55   implementation "com.android.support:support-annotations:${safeExtGet('supportLibVersion', '27.1.0')}"
     56   implementation "com.android.support:support-v4:${safeExtGet('supportLibVersion', '27.1.0')}"
     57 }

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.
To suppress this error, use the issue id "GradleDependency" as explained in the Suppressing Warnings and Errors section.
GradleDependency Correctness Warning Priority 4/10

## Gradle Dynamic Version

../../build.gradle:49: Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds (com.facebook.react:react-native:+)

     46 }
     47
     48 dependencies {
     49   compileOnly 'com.facebook.react:react-native:+'
     50   compileOnly 'com.facebook.infer.annotation:infer-annotation:+'
     51   implementation "com.google.zxing:core:3.3.0"
     52   implementation "com.drewnoakes:metadata-extractor:2.9.1"

../../build.gradle:50: Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds (com.facebook.infer.annotation:infer-annotation:+)

     47
     48 dependencies {
     49   compileOnly 'com.facebook.react:react-native:+'
     50   compileOnly 'com.facebook.infer.annotation:infer-annotation:+'
     51   implementation "com.google.zxing:core:3.3.0"
     52   implementation "com.drewnoakes:metadata-extractor:2.9.1"
     53   implementation "com.google.android.gms:play-services-vision:${safeExtGet('googlePlayServicesVersion', '15.0.2')}"

Using `+` in dependencies lets you automatically pick up the latest available version rather than a specific, named version. However, this is not recommended; your builds are not repeatable; you may have tested with a slightly different version than what the build server used. (Using a dynamic version as the major version number is more problematic than using it in the minor version position.)
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "GradleDynamicVersion" as explained in the Suppressing Warnings and Errors section.
GradleDynamicVersion Correctness Warning Priority 4/10

## File.setReadable() used to make file world-readable

../../src/main/java/com/lwansbrough/RCTCamera/RCTCameraModule.java:430: Setting file permissions to world-readable can be risky, review carefully

     427             return;
     428         }
     429
     430         f.setReadable(true, false); // so mediaplayer can play it
     431         f.setWritable(true, false); // so can clean it up
     432
     433         WritableMap response = new WritableNativeMap();

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`.
To suppress this error, use the issue id "SetWorldReadable" as explained in the Suppressing Warnings and Errors section.
SetWorldReadable Security Warning Priority 6/10

## File.setWritable() used to make file world-writable

../../src/main/java/com/lwansbrough/RCTCamera/RCTCameraModule.java:431: Setting file permissions to world-writable can be risky, review carefully

     428         }
     429
     430         f.setReadable(true, false); // so mediaplayer can play it
     431         f.setWritable(true, false); // so can clean it up
     432
     433         WritableMap response = new WritableNativeMap();
     434         switch (mRecordingOptions.getInt("target")) {

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`.
To suppress this error, use the issue id "SetWorldWritable" as explained in the Suppressing Warnings and Errors section.
SetWorldWritable Security Warning Priority 6/10

## Obsolete SDK_INT Version Check

../../src/main/java/com/google/android/cameraview/Camera1.java:176: Unnecessary; SDK_INT is never < 16

     173   if (mPreviewTexture != null) {
     174       mCamera.setPreviewTexture(mPreviewTexture);
     175   } else if (mPreview.getOutputClass() == SurfaceHolder.class) {
     176       final boolean needsToStopPreview = mShowingPreview && Build.VERSION.SDK_INT < 14;
     177       if (needsToStopPreview) {
     178           mCamera.stopPreview();
     179           mIsPreviewActive = false;

../../src/main/java/com/google/android/cameraview/Camera1.java:509: Unnecessary; SDK_INT is never < 16

     506      }
     507      mDisplayOrientation = displayOrientation;
     508      if (isCameraOpened()) {
     509          final boolean needsToStopPreview = mShowingPreview && Build.VERSION.SDK_INT < 14;
     510          if (needsToStopPreview) {
     511              mCamera.stopPreview();
     512              mIsPreviewActive = false;

../../src/main/java/com/google/android/cameraview/CameraView.java:132: Unnecessary; SDK_INT is never < 16

     129     @NonNull
     130     private PreviewImpl createPreviewImpl(Context context) {
     131         PreviewImpl preview;
     132         if (Build.VERSION.SDK_INT < 14) {
     133             preview = new SurfaceViewPreview(context, this);
     134         } else {
     135             preview = new TextureViewPreview(context, this);

../../src/main/java/org/reactnative/camera/RNCameraView.java:96: Unnecessary; SDK_INT is always >= 16

      93       promise.resolve(null);
      94   }
      95   final File cacheDirectory = mPictureTakenDirectories.remove(promise);
      96   if(Build.VERSION.SDK_INT >= 11/*HONEYCOMB*/) {
      97     new ResolveTakenPictureAsyncTask(data, promise, options, cacheDirectory, deviceOrientation, RNCameraView.this)
      98             .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      99   } else {

../../src/main/res/layout-v14: This folder configuration (`v14`) is unnecessary; `minSdkVersion` is 16. Merge all the resources in this folder into `layout`.
This check flags version checks that are not necessary, because the `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.
To suppress this error, use the issue id "ObsoleteSdkInt" as explained in the Suppressing Warnings and Errors section.
ObsoleteSdkInt Performance Warning Priority 6/10

## Static Field Leaks

../../src/main/java/org/reactnative/facedetector/tasks/FileFaceDetectionAsyncTask.java:38: This field leaks a context object

      35   private Promise mPromise;
      36   private int mWidth = 0;
      37   private int mHeight = 0;
      38   private Context mContext;
      39   private ReadableMap mOptions;
      40   private int mOrientation = ExifInterface.ORIENTATION_UNDEFINED;
      41   private RNFaceDetector mRNFaceDetector;

../../src/main/java/com/lwansbrough/RCTCamera/RCTCameraViewFinder.java:326: This AsyncTask class should be static or leaks might occur (com.lwansbrough.RCTCamera.RCTCameraViewFinder.ReaderAsyncTask)

     323         }
     324     }
     325
     326     private class ReaderAsyncTask extends AsyncTask<Void, Void, Void> {
     327         private byte[] imageData;
     328         private final Camera camera;

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 `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.
To suppress this error, use the issue id "StaticFieldLeak" as explained in the Suppressing Warnings and Errors section.
StaticFieldLeak Performance Warning Priority 6/10

## HashMap can be replaced with SparseArray

../../src/main/java/com/lwansbrough/RCTCamera/RCTCamera.java:466: Use `new SparseArray<CameraInfoWrapper>(...)` instead for better performance

     463
     464     private RCTCamera(int deviceOrientation) {
     465         _cameras = new HashMap<>();
     466         _cameraInfos = new HashMap<>();
     467         _cameraTypeToIndex = new HashMap<>();
     468
     469         _actualDeviceOrientation = deviceOrientation;

../../src/main/java/com/lwansbrough/RCTCamera/RCTCamera.java:467: Use new `SparseIntArray(...)` instead for better performance

     464     private RCTCamera(int deviceOrientation) {
     465         _cameras = new HashMap<>();
     466         _cameraInfos = new HashMap<>();
     467         _cameraTypeToIndex = new HashMap<>();
     468
     469         _actualDeviceOrientation = deviceOrientation;

For maps where the keys are of type integer, it's typically more efficient to use the Android `SparseArray` API. This check identifies scenarios where you might want to consider using `SparseArray` instead of `HashMap` for better performance.
This is particularly useful when the value types are primitives like ints, where you can use `SparseIntArray` and avoid auto-boxing the values from `int` to `Integer`.
If you need to construct a `HashMap` because you need to call an API outside of your control which requires a `Map`, you can suppress this warning using for example the `@SuppressLint` annotation.
To suppress this error, use the issue id "UseSparseArrays" as explained in the Suppressing Warnings and Errors section.
UseSparseArrays Performance Warning Priority 4/10

## Missing View constructors for XML inflation

../../src/main/java/com/google/android/cameraview/CameraView.java:44: Custom view `CameraView` is missing constructor used by tools: `(Context)` or `(Context,AttributeSet)` or `(Context,AttributeSet,int)`

      41 import java.util.Set;
      42 import java.util.SortedSet;
      43
      44 public class CameraView extends FrameLayout {
      45
      46     /** The camera device faces the opposite direction as the device's screen. */
      47     public static final int FACING_BACK = Constants.FACING_BACK;

../../src/main/java/com/lwansbrough/RCTCamera/RCTCameraViewFinder.java:37: Custom view `RCTCameraViewFinder` is missing constructor used by tools: `(Context)` or `(Context,AttributeSet)` or `(Context,AttributeSet,int)`

      34 import com.google.zxing.ResultPoint;
      35 import com.google.zxing.common.HybridBinarizer;
      36
      37 class RCTCameraViewFinder extends TextureView implements TextureView.SurfaceTextureListener, Camera.PreviewCallback {
      38     private int _cameraType;
      39     private int _captureMode;
      40     private SurfaceTexture _surfaceTexture;

../../src/main/java/org/reactnative/camera/RNCameraView.java:37: Custom view `RNCameraView` is missing constructor used by tools: `(Context)` or `(Context,AttributeSet)` or `(Context,AttributeSet,int)`

      34 import java.util.concurrent.ConcurrentHashMap;
      35 import java.util.concurrent.ConcurrentLinkedQueue;
      36
      37 public class RNCameraView extends CameraView implements LifecycleEventListener, BarCodeScannerAsyncTaskDelegate, FaceDetectorAsyncTaskDelegate,
      38     BarcodeDetectorAsyncTaskDelegate, TextRecognizerAsyncTaskDelegate, PictureSavedDelegate {
      39   private ThemedReactContext mThemedReactContext;
      40   private Queue<Promise> mPictureTakenPromises = new ConcurrentLinkedQueue<>();

Some layout tools (such as the Android layout editor) need to find a constructor with one of the following signatures:
* `View(Context context)`
* `View(Context context, AttributeSet attrs)`
* `View(Context context, AttributeSet attrs, int defStyle)`
If your custom view needs to perform initialization which does not apply when used in a layout editor, you can surround the given code with a check to see if `View#isInEditMode()` is false, since that method will return `false` at runtime but true within a user interface editor.
To suppress this error, use the issue id "ViewConstructor" as explained in the Suppressing Warnings and Errors section.
ViewConstructor Usability Warning Priority 3/10

## Accessibility in Custom Views

../../src/main/java/com/lwansbrough/RCTCamera/RCTCameraViewFinder.java:421: Custom view `RCTCameraViewFinder` overrides `onTouchEvent` but not `performClick`

     418   }
     419
     420   @Override
     421   public boolean onTouchEvent(MotionEvent event) {
     422       // Fast swiping and touching while component is being loaded can cause _camera to be null.
     423       if (_camera == null) {
     424           return false;

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.
To suppress this error, use the issue id "ClickableViewAccessibility" as explained in the Suppressing Warnings and Errors section.
ClickableViewAccessibility Accessibility Warning Priority 6/10

## Disabled Checks

One or more issues were not run by lint, either because the check is not enabled by default, or because it was disabled with a command line flag or via one or more `lint.xml` configuration files in the project directories.
AppLinksAutoVerifyError
Disabled By: Default
Ensures that app links are correctly set and associated with website.
More info: https://g.co/appindexing/applinks
To suppress this error, use the issue id "AppLinksAutoVerifyError" as explained in the Suppressing Warnings and Errors section.
AppLinksAutoVerifyWarning
Disabled By: Default
Ensures that app links are correctly set and associated with website.
More info: https://g.co/appindexing/applinks
To suppress this error, use the issue id "AppLinksAutoVerifyWarning" as explained in the Suppressing Warnings and Errors section.
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.
More info: http://developer.android.com/design/patterns/pure-android.html
To suppress this error, use the issue id "BackButton" as explained in the Suppressing Warnings and Errors section.
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.
Launcher icons must be in the PNG format.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "ConvertToWebp" as explained in the Suppressing Warnings and Errors section.
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.
To suppress this error, use the issue id "EasterEgg" as explained in the Suppressing Warnings and Errors section.
FieldGetter
Disabled By: Default
Accessing a field within the class that defines a getter for that field is at least 3 times faster than calling the getter. For simple getters that do nothing other than return the field, you might want to just reference the local field directly instead.
NOTE: As of Android 2.3 (Gingerbread), this optimization is performed automatically by Dalvik, so there is no need to change your code; this is only relevant if you are targeting older versions of Android.
More info: http://developer.android.com/guide/practices/design/performance.html#internal_get_set
To suppress this error, use the issue id "FieldGetter" as explained in the Suppressing Warnings and Errors section.
GoogleAppIndexingApiWarning
Disabled By: Default
Adds URLs to get your app into the Google index, to get installs and traffic to your app from Google Search.
More info: https://g.co/AppIndexing/AndroidStudio
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "GoogleAppIndexingApiWarning" as explained in the Suppressing Warnings and Errors section.
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.
More info: http://developer.android.com/design/style/iconography.html
To suppress this error, use the issue id "IconExpectedSize" as explained in the Suppressing Warnings and Errors section.
LogConditional
Disabled By: Default
The BuildConfig class (available in Tools 17) provides a constant, "DEBUG", which indicates whether the code is being built in release mode or in debug mode. In release mode, you typically want to strip out all the logging calls. Since the compiler will automatically remove all code which is inside a "if (false)" check, surrounding your logging calls with a check for BuildConfig.DEBUG is a good idea.
If you really intend for the logging to be present in release mode, you can suppress this warning with a @SuppressLint annotation for the intentional logging calls.
To suppress this error, use the issue id "LogConditional" as explained in the Suppressing Warnings and Errors section.
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.
More info: https://bugs.eclipse.org/bugs/show_bug.cgi?id=375421
To suppress this error, use the issue id "MangledCRLF" as explained in the Suppressing Warnings and Errors section.
MinSdkTooLow
Disabled By: Default
The value of the `minSdkVersion` property is too low and can be incrementedwithout noticeably reducing the number of supported devices.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "MinSdkTooLow" as explained in the Suppressing Warnings and Errors section.
MissingRegistered
Disabled By: Default
If a class is referenced in the manifest or in a layout file, it must also exist in the project (or in one of the libraries included by the project. This check helps uncover typos in registration names, or attempts to rename or move classes without updating the manifest file properly.
More info: http://developer.android.com/guide/topics/manifest/manifest-intro.html
To suppress this error, use the issue id "MissingRegistered" as explained in the Suppressing Warnings and Errors section.
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.
To suppress this error, use the issue id "NegativeMargin" as explained in the Suppressing Warnings and Errors section.
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 `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.
To suppress this error, use the issue id "NewerVersionAvailable" as explained in the Suppressing Warnings and Errors section.
PermissionImpliesUnsupportedChromeOsHardware
Disabled By: Default
The `<uses-permission>` element should not require a permission that implies an unsupported Chrome OS 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/topic/arc/manifest.html#implied-features
To suppress this error, use the issue id "PermissionImpliesUnsupportedChromeOsHardware" as explained in the Suppressing Warnings and Errors section.
Registered
Disabled By: Default
Activities, services and content providers should be registered in the `AndroidManifest.xml` file using `<activity>`, `<service>` and `<provider>` tags.
If your activity is simply a parent class intended to be subclassed by other "real" activities, make it an abstract class.
More info: http://developer.android.com/guide/topics/manifest/manifest-intro.html
To suppress this error, use the issue id "Registered" as explained in the Suppressing Warnings and Errors section.
SelectableText
Disabled By: Default
If a `<TextView>` is used to display data, the user might want to copy that data and paste it elsewhere. To allow this, the `<TextView>` should specify `android:textIsSelectable="true"`.
This lint check looks for TextViews which are likely to be displaying data: views whose text is set dynamically. This value will be ignored on platforms older than API 11, so it is okay to set it regardless of your `minSdkVersion`.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "SelectableText" as explained in the Suppressing Warnings and Errors section.
StopShip
Disabled By: Default
Using the comment `// STOPSHIP` can be used to flag code that is incomplete but checked in. This comment marker can be used to indicate that the code should not be shipped until the issue is addressed, and lint will look for these.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "StopShip" as explained in the Suppressing Warnings and Errors section.
TypographyQuotes
Disabled By: Default
Straight single quotes and double quotes, when used as a pair, can be replaced by "curvy quotes" (or directional quotes). This can make the text more readable.
Note that you should never use grave accents and apostrophes to quote, `like this'.
(Also note that you should not use curvy quotes for code fragments.)
More info: http://en.wikipedia.org/wiki/Quotation_mark
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "TypographyQuotes" as explained in the Suppressing Warnings and Errors section.
UnpackedNativeCode
Disabled By: Default
This app loads native libraries using `System.loadLibrary()`.
Consider adding `android:extractNativeLibs="false"` to the `<application>` tag in AndroidManifest.xml. Starting with Android 6.0, this will make installation faster, the app will take up less space on the device and updates will have smaller download sizes.
To suppress this error, use the issue id "UnpackedNativeCode" as explained in the Suppressing Warnings and Errors section.
UnsupportedChromeOsHardware
Disabled By: Default
The `<uses-feature>` element should not require this unsupported Chrome OS 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 Chrome OS device are reviewed and marked as not required in the manifest.
More info: https://developer.android.com/topic/arc/manifest.html#incompat-entries
To suppress this error, use the issue id "UnsupportedChromeOsHardware" as explained in the Suppressing Warnings and Errors section.
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.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "UnusedIds" as explained in the Suppressing Warnings and Errors section.
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.
More info: http://developer.android.com/guide/components/processes-and-threads.html#Threads
To suppress this error, use the issue id "WrongThreadInterprocedural" as explained in the Suppressing Warnings and Errors section.

## Suppressing Warnings and Errors

Lint errors can be suppressed in a variety of ways:
1. With a `@SuppressLint` annotation in the Java code
2. With a `tools:ignore` attribute in the XML file
3. With 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 http://g.co/androidstudio/suppressing-lint-warnings