googlesamples / android-vision

Deprecated: The Mobile Vision API is now a part of ML Kit: Check out this repo:
https://github.com/firebase/quickstart-android/tree/master/mlkit
Apache License 2.0
2.93k stars 1.73k forks source link

Native ocr lib crash #269

Closed GEllickson closed 6 years ago

GEllickson commented 6 years ago

Our app uses text and barcode detection, and a very small minority have been experiencing this crash. I can only see the crash through Google Play and not through our Crashlytics integration. The devices have only been various new-ish Samsung devices running Nougat (both 7 and 7.1), but majority with those same specs have been fine. The crash happens consistently with those users though, and effectively renders our in-app camera non-functional for them.

Is there anything I could do in-app to prevent this or is this a library bug? We do check if the detectors are operational before using them.

native: pc 000000000006fc2c  /system/lib64/libc.so (tgkill+8)
  native: pc 000000000006cf40  /system/lib64/libc.so (pthread_kill+64)
  native: pc 00000000000251f8  /system/lib64/libc.so (raise+24)
  native: pc 000000000001ccc4  /system/lib64/libc.so (abort+52)
  native: pc 00000000004750d0  /data/data/com.google.android.gms/app_vision/ocr/libs/arm64-v8a/libocr.so
  native: pc 0000000000475770  /data/data/com.google.android.gms/app_vision/ocr/libs/arm64-v8a/libocr.so
  native: pc 0000000000475814  /data/data/com.google.android.gms/app_vision/ocr/libs/arm64-v8a/libocr.so
  native: pc 0000000000474830  /data/data/com.google.android.gms/app_vision/ocr/libs/arm64-v8a/libocr.so
  native: pc 000000000026cee4  /data/data/com.google.android.gms/app_vision/ocr/libs/arm64-v8a/libocr.so
  native: pc 0000000000271190  /data/data/com.google.android.gms/app_vision/ocr/libs/arm64-v8a/libocr.so
  native: pc 0000000000065794  /data/data/com.google.android.gms/app_vision/ocr/libs/arm64-v8a/libocr.so
  native: pc 0000000000065488  /data/data/com.google.android.gms/app_vision/ocr/libs/arm64-v8a/libocr.so
  native: pc 000000000027caf4  /data/data/com.google.android.gms/app_vision/ocr/libs/arm64-v8a/libocr.so
  native: pc 0000000000280274  /data/data/com.google.android.gms/app_vision/ocr/libs/arm64-v8a/libocr.so
  native: pc 0000000000067c84  /data/data/com.google.android.gms/app_vision/ocr/libs/arm64-v8a/libocr.so
  native: pc 0000000000067f64  /data/data/com.google.android.gms/app_vision/ocr/libs/arm64-v8a/libocr.so
  native: pc 0000000000063dec  /data/data/com.google.android.gms/app_vision/ocr/libs/arm64-v8a/libocr.so
  native: pc 000000000038c5e0  /data/user_de/0/com.google.android.gms/app_chimera/m/0000002b/oat/arm64/DynamiteModulesA_GmsCore_prodmnc_xxhdpi_release.odex
bibek011 commented 6 years ago

looks like Clearing All Data of Google Play service worked for me at least for now.

yonifine commented 6 years ago

@bibek011 thanks, looks it worked for me as well after clearing Google Play services.

barmic12 commented 6 years ago

@bibek011, works for me too, thanks man!

zebpaypeswani commented 6 years ago

We are adding the device list in firebase. if more devices are crashing then we will manually add them in firebase. On client side we check the device against the list. This way we can save few more crashes.

lodenrogue commented 6 years ago

I feel like Google needs to put out an emergency fix for this. Please do something!

barmic12 commented 6 years ago

Clearing All Data from Google Play services helps only for a moment. During on first run, app starts, if I run again, unfortunatelly it crash...

bibek011 commented 6 years ago

@barmic12 for me it's still working. which google play service version are you using. i am on 11.9.45 which released yesterday.

PlayableApps commented 6 years ago

@bibek011 latest version is 11.6.0 i believe!

bibek011 commented 6 years ago

@PlayableApps i have joined the beta tester for the Google Play Service maybe that's why i have 11.9.45

evis94 commented 6 years ago

Any progress? the list of devices crashing is getting bigger and bigger each day. A lot of the users are rating our app with a 1 star vain.

nhattv18 commented 6 years ago

Too long time to fix the problem :( We are still looking forward to the new version.

amiraelsayed commented 6 years ago

hello I am facing the same problem, the ocr library was working with me on android 7.0 couple of days ago and suddenly I try to open it today to find this native error, please solve it as soon as you can

liuyl commented 6 years ago

Ask bibek011@ mentioned, the new Google Play Service version with OCR fix is currently in Beta channel.

zenomat commented 6 years ago

Thanks @liuyl . It's finally working :)

raulsb commented 6 years ago

Only in beta Channel or it's already production released?

PlayableApps commented 6 years ago

@liuyl how do we use it in our app ?

Cliffordwh commented 6 years ago

When will it go into production?? Still baffles me that Google can roll out software without Unit testing this stuff!

liuyl commented 6 years ago

It's currently in beta channel and will roll out in the following weeks, you cannot force your App use the beta Google Play Services. At the meantime I'd suggest disable the OCR feature on devices that may crash.

Again we apologize for the crash. We do have unit tests, but unfortunately we didn't run these tests on all devices.

PlayableApps commented 6 years ago

@liuyl thank you , is it a good idea to let users update their google play services

Yrlec commented 6 years ago

Two questions:

  1. How come the faulty version was pushed into production after the issue had been identified? Having a beta channel serves no purpose if you ignore the issues found in the beta.
  2. How come you cannot push it faster to production now that a fix has been created?
whiteLT commented 6 years ago

Any news?

evis94 commented 6 years ago

@liuyl any updates?

PlayableApps commented 6 years ago

we are losing so many users oh god could you please hurry up this is really destroying our app

lodenrogue commented 6 years ago

Obviously Google doesn't care about it's API user base. If they did they would have put out an emergency fix on day 1. I've lost all faith in Google.

duyp commented 6 years ago

All I can do right now is disable OCR feature on listed devices as @Yrlec, thank you, and also alert all other users that this feature might causes terrible crashes :(

This issue got me lots of 1 star, so sad! Hope Google team is going to fix soon.

duyp commented 6 years ago

@Yrlec: My phone is Galaxy J7 Prime, OCR lib still works well but your code shouldDisableTextCheck return true

raulsb commented 6 years ago

@liuyl this is the only free and efficient service that I have found for my application and the fact that it was a Google own library gave my application a little extra, my app works with the Text Recognizer as main feature, my boss still asks for a release date for the new Google Play Services, please I'm only asking for an estimated date, could you please give us an estimated date?

liuyl commented 6 years ago

@raulsb The release is rolling out slowly, some devices already get the fix in the past weeks. The best estimation I can give is we plan to push to 100% by end of the year.

evis94 commented 6 years ago

@liuyl

The release is rolling out slowly, some devices already get the fix in the past weeks.

Can you help understand what this means exactly? Once a release of the library with fix is ready we don't need to update the dependency on our application and create a release?

liuyl commented 6 years ago

@evis94 You don't need to do anything once the fix is released to 100%.

nativ18 commented 6 years ago

This issue is also happening on Google Pixel smartphone with Play Services version 11.7.46

nhattv18 commented 6 years ago

@liuyl Can you give me the list of devices that have been updated Google Play Services. I can unblock them on the Google Play Store. Thanks!

vlad2711 commented 6 years ago

I also have same problem(device: Xiaomi mi max) my client want to implement this library, but I can't create bad app. You fix this bug so slow.

nhattv18 commented 6 years ago

@zebpaypeswani My device is samsung s8 (dreamlte), but currently there is no update . The latest version is 11.7.46

zebpaypeswani commented 6 years ago

@nhattv18 sorry it was the list of crashing devices.

nhattv18 commented 6 years ago

My device (Samsung S8 - dreamlte) has been updated to the latest version (11.9.51) and Text API works fine. Thank development team!

vlad2711 commented 6 years ago

In my device bug already fixed! Thanks

PlayableApps commented 6 years ago

i'm not getting crashes report anymore, Thank you dev team!

radheshyamsingh24 commented 6 years ago

It's working fine for me also. Thanks development team!

LucianIacob commented 6 years ago

It's working very well for me also!!

raulsb commented 6 years ago

It's already working, Thanks @liuyl and development team!

wanwjing commented 6 years ago

Anyone knowing this ? Frame imageFrame = new Frame.Builder().setBitmap(bitmap).build(); TextRecognizer textRecognizer = new TextRecognizer.Builder(context).build();

I hit this error. E/TextNativeHandle: Error creating remote native handle com.google.android.gms.dynamite.DynamiteModule$zza: No acceptable module found. Local version is 0 and remote version is 0. at com.google.android.gms.dynamite.DynamiteModule.zza(Unknown Source) at com.google.android.gms.internal.zzbjz.zzTU(Unknown Source) at com.google.android.gms.internal.zzbkn.(Unknown Source) at com.google.android.gms.vision.text.TextRecognizer$Builder.build(Unknown Source)

liuyl commented 6 years ago

Thanks everyone for your patience, I am glad that the bug is fixed.

@wanwjing, the error message probably means you don't have Google Play Service on your device.

duyp commented 6 years ago

In my application, text detection is fixed absolutely on latest version, but I got new crash on Barcode detection:

01-07 18:15:39.521 2315-2315/? A/DEBUG: 01-07 18:15:39.521 2315-2315/? A/DEBUG: Build fingerprint: 'samsung/j7xeltexx/j7xelte:6.0.1/MMB29K/J710FXXU1APDB:user/release-keys' 01-07 18:15:39.521 2315-2315/? A/DEBUG: Revision: '6' 01-07 18:15:39.521 2315-2315/? A/DEBUG: ABI: 'arm' 01-07 18:15:39.521 2315-2315/? A/DEBUG: pid: 32706, tid: 432, name: Thread-26201 >>> myPackageName <<< 01-07 18:15:39.521 2315-2315/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xc 01-07 18:15:39.561 2315-2315/? A/DEBUG: r0 c67c2190 r1 00000042 r2 c67c2168 r3 00000000 01-07 18:15:39.561 2315-2315/? A/DEBUG: r4 00000000 r5 c67c2168 r6 cf9eb220 r7 cf9eb334 01-07 18:15:39.561 2315-2315/? A/DEBUG: r8 00000408 r9 00000001 sl 43b00000 fp 42840000 01-07 18:15:39.561 2315-2315/? A/DEBUG: ip f3383060 sp cf9eb210 lr 00000018 pc d05d2c12 cpsr 000b0030 01-07 18:15:39.561 2315-2315/? A/DEBUG: backtrace: 01-07 18:15:39.561 2315-2315/? A/DEBUG: #00 pc 00011c12 /data/data/com.google.android.gms/app_vision/barcode/libs/armeabi-v7a/libbarhopper.so 01-07 18:15:39.561 2315-2315/? A/DEBUG: #01 pc 0000a345 /data/data/com.google.android.gms/app_vision/barcode/libs/armeabi-v7a/libbarhopper.so 01-07 18:15:39.561 2315-2315/? A/DEBUG: #02 pc 0000331d /data/data/com.google.android.gms/app_vision/barcode/libs/armeabi-v7a/libbarhopper.so 01-07 18:15:39.561 2315-2315/? A/DEBUG: #03 pc 000043df /data/data/com.google.android.gms/app_vision/barcode/libs/armeabi-v7a/libbarhopper.so 01-07 18:15:39.561 2315-2315/? A/DEBUG: #04 pc 00001e63 /data/data/com.google.android.gms/app_vision/barcode/libs/armeabi-v7a/libbarhopper.so 01-07 18:15:39.561 2315-2315/? A/DEBUG: #05 pc 00002a91 /data/data/com.google.android.gms/app_vision/barcode/libs/armeabi-v7a/libbarhopper.so (Java_com_google_android_gms_vision_barcode_internal_NativeBarcodeDetector_recognizeNative+40) 01-07 18:15:39.561 2315-2315/? A/DEBUG: #06 pc 0063e70f /data/data/com.google.android.gms/app_chimera/m/0000002a/oat/arm/DynamiteModulesA_GmsCore_prodmnc_xhdpi_release.odex (offset 0x3a5000)

App's google play service version: 11.8.0 Device's google play service version: 11.9.51

Please have a look.

liuyl commented 6 years ago

Hi @duyp, sorry to hear that. Could you please open a new issue for that?

ghost commented 6 years ago

Hi @liuyl !! I still got this issue. I have it when I try to create TextRecognizer on my own project, it is fine when I'm running your sample. Here are my logs:

I/Vision: Loading library libocr.so I/Vision: libocr.so library load status: true I/Vision: Reading ocr models from /data/user/0/com.google.android.gms/app_vision/ocr/data/models I/native: jni_helper.cc:166 Loading model config /data/user/0/com.google.android.gms/app_vision/ocr/data/models/semanticlift_engine_0.2.bincfg E/native: jni_helper.cc:170 GetContents failed: /data/user/0/com.google.android.gms/app_vision/ocr/data/models/semanticlift_engine_0.2.bincfg I/native: jni_helper.cc:166 Loading model config /data/user/0/com.google.android.gms/app_vision/ocr/data/models/tfmini_lstm_engine_latin_0.2.bincfg I/native: timer.cc:70 PhotoOcrEngine::Init (detector): 0.183 ms (elapsed) I/native: timer.cc:70 BeamSearch::Init (mutator): 0.016 ms (elapsed) I/native: timer.cc:70 PhotoOcrEngine::Init (recognizer): 1.087 ms (elapsed) I/native: timer.cc:70 void ocr::photo::PhotoOcrEngine::Init(): 1.536 ms (elapsed)

My test device is a Lenovo P2a42 android 7.0.

I guess if it is working with your sample it should work on my project too. Is there any reason why this error occured ? I mean other than the one pointed out in november ?

loihd commented 6 years ago

Hello! I'm still getting the issue on Asus ZenFone 5 (A501CG) E/native: jni_helper.cc:170 GetContents failed: /data/data/com.google.android.gms/app_vision/ocr/data/models/rpn_lstm_engine_tfmini.bincfg E/native: jni_helper.cc:170 GetContents failed: /data/data/com.google.android.gms/app_vision/ocr/data/models/semanticlift_engine_0.2.bincfg

Can you please check and fix the issue? Thank you

musti-91 commented 5 years ago

Any progress on the last two issues? I'm still getting this error. Android: 28 Firebase MLkit: 20.0.0

Screenshot 2019-06-03 at 14 36 40