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
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…