3

I am using Google's OCR library to detect text from image in my App. Earlier It was working fine but suddenly it has started giving error. I am getting crash during instantiation on TextReconiger. I am getting this crash on some devices like Samsung S6 edge, Samsung S7 etc and on some devices it is working fine.

I am getting crash on this line in my code

TextRecognizer textRecognizer = new TextRecognizer.Builder(context).build();

crash log :

  native: pc 000000000006f9fc  /system/lib64/libc.so (tgkill+8)
  native: pc 000000000006cd10  /system/lib64/libc.so (pthread_kill+64)
  native: pc 0000000000025078  /system/lib64/libc.so (raise+24)
  native: pc 000000000001cc04  /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 0000000000387e60  
/data/user_de/0/com.google.android.gms/app_chimera/m/00000027/oat/arm64
/DynamiteModulesA_GmsCore_prodmnc_xxhdpi_release.odex

This crash is affecting rating of my App on Google play store. From this crash log i am not getting any idea how to fix this. If someone knows the solution for this issue please help me out.

Radheshyam Singh
  • 479
  • 3
  • 10
  • 3
    If you have a question & you have an answer for it & if the solution is not available on SO, then explain the problem with relevant info in question & then provide your solution as an answer. – iYoung Nov 09 '17 at 14:08

2 Answers2

1

I have implemented some logic in App side to reduce crashes.

From App side we can do one thing which will minimize crashes. We can write code to track if app is crashing on device during instantiation of TextRecognizer object and then from next time we can bypass/disable OCR feature. But on other devices(on which there is no crash) it will work perfectly.

This will lead to crash once on impacted devices and from next time no crash(Yes, it will impact feature).

boolean isFirstTimeUser = getBooleanFromPreference (default value TRUE) 
boolean isGVSupportThisDevice = getBooleanFromPreference (default value False)

if (isFirstTimeUser || isGVSupportThisDevice) {

     Update Preference to make isFirstTimeUser to false

     textRecognizer = new TextRecognizer.Builder(context).build();

     Update Preference to make isGVSupportThisDevice to True
}

May be this will help little bit. Thanks

Radheshyam Singh
  • 479
  • 3
  • 10
  • Update Preference to make isGVSupportThisDevice to false last line should be true instead of false, correct me if I'm wrong please. – EviatarS Nov 09 '17 at 15:05
  • what we are doing is keeping device list which are crashing on Firebase. If any device crash then we are manually adding the device in firebase. from GitHub issue page we already have hundreds of devices already. – Sunny Nov 10 '17 at 11:45
0

I have the same problem and the same error trace.

I read that the new Google Play Service version with OCR fix is currently in Beta channel. I've just tested it and is working!

https://play.google.com/apps/testing/com.google.android.gms

Sinffredy
  • 31
  • 8