Known issues

Android issues

  • InputImage constructed by Bitmap with a non zero rotationDegrees causes an "invalid rotation" MlKitException for FaceDetection API since and Please use an earlier version and wait for our next release which includes the fix for this issue.
  • BarcodeScanning SDKs pior to and do not work on some devices running with camera-camera2:1.0.0-beta08 version or later. You can use an earlier version of camera-camera2 to bypass this issue. For example:

    implementation ""
    implementation ""
    implementation ""
    implementation ""
    implementation ""

  • Native methods might be obfuscated by custom rules in or earlier. Include the following rule to keep them if you encounter errors like java.lang.UnsatisfiedLinkError:

    -keepclasseswithmembernames class {
      native <methods>;

  • For the Text Recognition, Image Labeling, and Object Detection and Tracking APIs, the performance with CameraX and Camera2 is still not on par with Camera1, because it takes more time to do format conversion for image from CameraX and Camera2.

  • Task callbacks might execute after the Activity or Fragment in which they have been registered has been destroyed. This might lead to an exception if the callback tries to access a detector that has been closed in the meantime. If you are using ML Kit in an Activity, you can register an Activity-scoped listener, which is automatically removed when the Activity is stopped. If you are using ML Kit in a Fragment or other environment, you can provide a custom executor that shuts down execution when the Fragment is destroyed. See ScopedExecutor.Java in the Vision Quickstart for an example.

  • For Image Labeling with image formats other than Bitmap, bundled variant has better performance than "thin" variant that depends on Google Play Services.

  • For Digital Ink and Entity Extraction, you will get the following runtime exception if you set targetSdkVersion to 31 and run on Android S.

    Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
    AndroidRuntime: Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
    We will update our SDK when the fix in goes to stable. Currently as a workaround, you can either set targetSdkVersion less than 31 or add following to your build.gradle.
    // For apps targeting Android S+, add the following
    constraints {
      implementation ''