Google Mobile Vision library not downloading
Asked Answered
L

6

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.

Lift answered 6/3, 2017 at 14:51 Comment(6)
I hava the same problem with the exact same error message. Did you find a solutionMichail
I have yet to find a solution, sorry.Lift
add <uses-permission android:name="android.permission.INTERNET" /> to manifestVelum
Clearing cache for Google play services on my mobile device helped. After clearing the cache I tried running the OCR app and it still didn't work. I launched play store, left my phone for some time and Bingo! It works...Someway
It should work after clearing google play service data and applications data.Burnley
In case it helps, it did not want to download until I signed into Google Play.Cockney
M
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

Miru answered 2/6, 2017 at 17:29 Comment(1)
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 possibleVinny
C
5

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

Carolynncarolynne answered 10/7, 2017 at 2:31 Comment(0)
M
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.

Matelot answered 14/3, 2017 at 12:35 Comment(2)
Thank you, but this didn't solve my problem. I am still getting the same error message.Lift
Make sure to use android:value="ocr" instead of android:value="barcode", if you try to use text recognition.Orchestra
B
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.

Burdette answered 20/6, 2018 at 15:25 Comment(0)
S
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.

Shaunta answered 21/4, 2017 at 18:23 Comment(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 ..Miru
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..Miru
E
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.

Empedocles answered 16/7, 2020 at 17:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.