15

I am trying to implement the Google Mobile Vision TextRecogniser API into my app, to read text off a given Image. When I try to use the feature, I get this error:

W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found.
I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:801
I/DynamiteModule: Selected remote version of com.google.android.gms.vision.dynamite, version >= 801
W/System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/00000005/n/arm64-v8a
D/ApplicationLoaders: ignored Vulkan layer search path /data/app/com.google.android.gms-1/lib/arm64:/system/fake-libs64:/data/app/com.google.android.gms-1/base.apk!/lib/arm64-v8a for namespace 0x7a2e8c60f0
I/Vision: Loading libocr library
I/Vision: libocr load status: false
I/TextRecognizerCreatorImpl: Requesting download for native text recognizer
W/TextNativeHandle: Native handle not yet available. Reverting to no-op handle.

Meaning, I believe, that the library wasnt downloaded to the phone.

I have troubleshooted for common error sources, including missing internet connection, lack of memory, missing dependencies, rebooting the phone, updating Google play services, waiting a while etc. Google repository and Play services are also updated in Android studio.

Yet, I still get the same error, even when trying my App on different devices.

BSMP
  • 4,596
  • 8
  • 33
  • 44

6 Answers6

7

I believe that the download is performed by the Google Play Service App. The Libraries are downloaded as a zip file in the folder

/data/data/com.google.android.gms/cache/downloadservice

and are extracted to

 /data/data/com.google.android.gms/files/com.google.android.gms.vision

and our app always check for the library in path

    06-02 22:43:53.379 30258-30419/pzy64.searchbot I/Vision: Loading library libocr.so

which shows the error if the files are absent

    06-02 22:43:53.475 30258-30419/pzy64.searchbot I/Vision: libocr.so library load status: false   

otherwise

    06-03 09:42:33.372 23451-24679/pzy64.searchbot I/Vision: libocr.so library load status: true

After download, In my case (ARM) the folder size of

 /data/data/com.google.android.gms/files/com.google.android.gms.vision

is around 5MB.(So the file downloaded is less than this size, The size may vary for different architecture .It took more time to download in my Asus Phone (x86)).

See my Logcat - (filter using 'Vision').

06-02 22:45:45.489 14970-31705/? I/Vision: Registration status ocr_armeabi_v7a.zip: The download is in progress.
06-02 22:45:45.542 14970-31705/? I/Vision: Download status ocr_armeabi_v7a.zip: The download is in progress.
06-02 22:43:53.379 30258-30419/pzy64.searchbot I/Vision: Loading library libocr.so
06-02 22:43:53.387 30258-30419/pzy64.searchbot I/Vision: libocr.so library load status: false
06-02 22:43:53.410 30258-30419/pzy64.searchbot I/Vision: Loading library libocr.so
06-02 22:43:53.411 30258-30419/pzy64.searchbot I/Vision: libocr.so library load status: false
06-02 22:43:53.475 30258-30419/pzy64.searchbot I/Vision: Loading library libocr.so
06-02 22:43:53.475 30258-30419/pzy64.searchbot I/Vision: libocr.so library load status: false
................... ..............
................... ..............

06-02 22:51:08.364 14970-3424/? I/Vision: Finished download ocr_armeabi_v7a.zip
06-02 22:51:08.421 14970-3424/? I/Vision: Unzipping /data/data/com.google.android.gms/cache/downloadservice/ocr_armeabi_v7a.zip to /data/data/com.google.android.gms/files/com.google.android.gms.vision/ocr
06-02 22:51:08.645 14970-3424/? I/Vision: Time to download ocr: 436558
06-02 22:51:09.142 3303-3489/pzy64.searchbot I/Vision: Loading library libocr.so
06-02 22:51:09.149 3303-3489/pzy64.searchbot I/Vision: libocr.so library load status: true
06-02 22:51:09.149 3303-3489/pzy64.searchbot I/Vision: Reading ocr models from /data/data/com.google.android.gms/files/com.google.android.gms.vision/ocr/data/models

The app i'm working on

pz64_
  • 2,212
  • 2
  • 20
  • 43
  • i am getting one of the devices and its saying not operational i don't know how to fix that do you any tips to fix ot not possible – TheCodeTalker May 31 '18 at 09:34
5

I do "Clear Data" of the Google Play Service app and it works!

vanna
  • 949
  • 2
  • 9
  • 16
3

I think you missed out adding the "meta-data" tag in manifest file of your application. This meta-data tag tells your application to download and integrate the library to your application. Try adding a meta-data tag in your "application" tag above "activity" tag in the manifest file. See below:

<application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
        <meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode"/>
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

This might solve your issue.

Akhil Ghatiki
  • 1,140
  • 12
  • 29
  • Thank you, but this didn't solve my problem. I am still getting the same error message. –  Apr 14 '17 at 09:32
  • 2
    Make sure to use `android:value="ocr"` instead of `android:value="barcode"`, if you try to use text recognition. – Alex Jul 03 '17 at 20:45
3

I don't know if I am too late, but guys, after hours of challenges for me the problem was solved by Updating Google Play Services to version (12.6.85). I restarted the device and guess what? The app worked fine. For updating this Google play service these instructions.

GabLeRoux
  • 16,715
  • 16
  • 63
  • 81
1

after some trials I figured out that in the gradle file you have to add these lines, too:

compile 'com.android.support:support-v4:24+'
compile 'com.android.support:design:24+'

So apart from this one

compile 'com.google.android.gms:play-services-vision:10.2.1' the other two lines are important, too.

Youcef LAIDANI
  • 55,661
  • 15
  • 90
  • 140
ferenc
  • 27
  • 2
  • 2
    Even if the log prints "libocr load status: false" it's still downloading in the background. Even after the download is completed, the log isn't changing.. We need to exit the app ,clear it from memory , Open again inorder to see if working..You can see it by filtering the logcat with 'Vision'. I believe the download is performed by the playservices. Above trial worked for you..because it got enough time to download the library while you perform trials .. – pz64_ Jun 02 '17 at 16:11
  • After waiting you can see this from log. *libocr.so library load status: true* .. *Reading ocr models from /data/data/com.google.android.gms/files/com.google.android.gms.vision/ocr/data/models*.. – pz64_ Jun 02 '17 at 16:17
0

I had the exact same problem. As soon as I logged in to Google Play service then it downloaded and the barcode detector worked in the camera.

Martin Naughton
  • 1,476
  • 17
  • 14