Search code examples
androidgoogle-play-servicesbarcodegoogle-visionandroid-vision

Google Vision barcode library not found


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.


Solution

  • 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.