I'm trying to use the new feature in Google Play Services (Vision) to add QR code scanning to my application. But when I run my app I get this:
I/Vision﹕ Supported ABIS: [armeabi-v7a, armeabi]
D/Vision﹕ Library not found: /data/data/com.google.android.gms/files/com.google.android.gms.vision/barcode/libs/armeabi-v7a/libbarhopper.so
I/Vision﹕ Requesting barcode detector download.
I have declared barcode dependency as per tutorial:
<meta-data
android:name="com.google.android.gms.vision.DEPENDENCIES"
android:value="barcode" />
I tried reinstalling the app and restarting the phone, nothing helps.
Using Google Play Services 7.8, version installed on the device is 7.8.11.
compile 'com.google.android.gms:play-services-vision:7.8.0'
Code used for creating the barcode detector:
boolean initBarcodeDetector() {
final BarcodeTrackerFactory barcodeTrackerFactory = new BarcodeTrackerFactory(this);
final MultiProcessor<Barcode> multiProcessor = new MultiProcessor.Builder<>(barcodeTrackerFactory)
.build();
barcodeDetector = new BarcodeDetector.Builder(this)
.build();
barcodeDetector.setProcessor(multiProcessor);
if (barcodeDetector.isOperational() == false) {
Toast.makeText(this, R.string.barcode_not_operational, Toast.LENGTH_LONG).show();
finish();
return false;
}
return true;
}
the above close returns false and finishes activity because barcodeDetector.isOperational()
returns false
.
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.