Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
406 views
in Technique[技术] by (71.8m points)

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...