Google Vision barcode library not found Google Vision barcode library not found android android

Google Vision barcode library not found


Google has confirmed a bug that they will fix soon, which prevents you in some cases to use this library of barcode/face-detection (link here) :

  • A service required by Mobile Vision is now disabled due to a serious bug in that service. This will prevent users who have not already used face or barcode detection from using those features. We do not recommend adding new Mobile Vision features to your app until this issue is fixed.
  • For apps that already use Mobile Vision features, check FaceDetector.isOperational() or BarcodeDetector.isOperational() to confirm detector readiness before using the face or barcode detector.

It's also written in some issues reported on Google's github sample repo:

https://github.com/googlesamples/android-vision/issues

Example (here) :

There is a known issue with the new version of GMSCore (v9) that was just released today.


It started working after I cleared cache and freed up some space. I had "only" 400mb free space and there was no error message which would indicate that.


Based on the documentation here: https://developers.google.com/android/reference/com/google/android/gms/vision/package-summary and here: https://developers.google.com/android/reference/com/google/android/gms/vision/Detector#isOperational()

Documentation:

public boolean isOperational()

Indicates whether the detector has all of the required dependencies available locally in order to do detection.

When an app is first installed, it may be necessary to download required files. If this returns false, those files are not yet available. Usually this download is taken care of at application install time, but this is not guaranteed. In some cases the download may have been delayed.

If your code has added a processor, an indication of the detector operational state is also indicated with the detectorIsOperational() method. You can check this in your app as it processes detection results, and can convey this state to the user if appropriate.

Returns •true if the detector is operational, false if the dependency download is in progress

and

public boolean detectorIsOperational()

Returns true if the detector is operational, false if it is not operational. In the non-operational case, the detector will return no results.

A detector may be non-operational for a while when starting an app for the first time, if a download is required to obtain the associated library and model files required to do detection.

It looks like your device needs to finish downloading the libraries through Google Play Services in order for your application to work right away.

Based on the Google Samples(a comment in the source):

        // Note: The first time that an app using the barcode or face API is installed on a        // device, GMS will download a native libraries to the device in order to do detection.        // Usually this completes before the app is run for the first time.  But if that        // download has not yet completed, then the above call will not detect any barcodes        // and/or faces.        //        // isOperational() can be used to check if the required native libraries are currently        // available.  The detectors will automatically become operational once the library        // downloads complete on device.

https://github.com/googlesamples/android-vision/blob/master/visionSamples/multi-tracker/app/src/main/java/com/google/android/gms/samples/vision/face/multitracker/MultiTrackerActivity.java#L156