android-vision icon indicating copy to clipboard operation
android-vision copied to clipboard

Does not read the QR on Huawei devices

Open danielemaddaluno opened this issue 6 years ago • 35 comments

The activity works fine, I even see the camera working good but there is no text scan. My phone is a Huawei P10 Lite (WAS-LX1AC432B198)

danielemaddaluno avatar May 10 '18 19:05 danielemaddaluno

Same problem occurred on Huawei MediaPad T3 10(AGS-W09C229B251). Until May 10th, the device could read the QR. But since May 11th, the device hasn't read.

auto-ororo avatar May 14 '18 04:05 auto-ororo

Same problem here. Lots of users had reported this problems occurred on Huawei over the past few days.

x51811danny avatar May 14 '18 08:05 x51811danny

Yes,

Same problem here, with the test app and our app which is in production (available in Google Store). HUAWEI FRD-L09 (Android 7.0, API 24) (Honor 8)

VEIKKO99 avatar May 14 '18 10:05 VEIKKO99

+1

Huawei GR5 2017 (Premium) Android Version 7.0

sattha avatar May 15 '18 03:05 sattha

I manage to let it work by...

inform my user (internal user) to download application with WiFi only! Becuase, there is some setting in Huawei can limit background service on other connectivity except WiFi.

But this is just a workaround, plz help us fix this issues.

sattha avatar May 15 '18 04:05 sattha

Not working for me this workaround

algibe avatar May 15 '18 09:05 algibe

Yeah for some device (but still Huawei) what I have done to fix this issue so far from my above comment is

  1. ask them to check gms service, is there any update https://play.google.com/store/apps/details?id=com.google.android.gms
  2. if already update, I ask them to clear google play service cache
  3. open an app and wait for some time (5 min.), I have experienced that at first, it does not operate but wait for a while it does (it's due to a network).

additional but not necessary for above workaround I also, update my AndroidManifest.xml by adding the following one

<meta-data 
            android:name="com.google.android.gms.vision.DEPENDENCIES" 
            android:value="barcode" /> 

sattha avatar May 16 '18 01:05 sattha

The problem of this issue is gotten on all the Huawei with an equal or higher os than 7. Google Play Services has been uploaded to 12.6.85 to solve the problem on Maps (apps like Uber were getting an error) but it seems that the error persist on the MobileVision library. Do anybody knows an email to report the google team?

kiketen avatar May 21 '18 15:05 kiketen

I'm seeing the same issue, but apparently only on devices with the hardware support level of "Limited" (which unfortunately means a lot of Huawei devices). Not seeing the same issue on an older P8 lite ("Legacy").

Meanwhile all devices updated to the fixing version 12.6.85, however one still needs to clear the app data of the Play Services manually in order for the vision lib to work again.

rdoubleui avatar May 22 '18 08:05 rdoubleui

Same problem on Huawei P10 Lite

andreasciarra avatar May 23 '18 12:05 andreasciarra

Same problem on Huawei P9 Lite and on Huawei P20

ngallazzi avatar May 23 '18 15:05 ngallazzi

@ngallazzi @andreasciarra try to clear the app data of the Play Services (cache is not sufficient) and you should be back to normal.

rdoubleui avatar May 23 '18 17:05 rdoubleui

I solved it adding in the manifest what @sattha said <meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode" /> And deleting all data and cache of Google Play Services and Google Play services for Instant Apps.

elekiwi avatar May 24 '18 09:05 elekiwi

Hi @bertam, could you do this test? Reboot your Huawei and then, try to scan the barcode again. In my case the error is there again...

kiketen avatar May 24 '18 12:05 kiketen

You are right @kiketen , I have to delete all the data and cache again in order to make it work.

elekiwi avatar May 25 '18 08:05 elekiwi

It's totally crazy what is happening with this bug...we cannot solve it by ourselves and Huawei and Google haven't solved it yet...We are getting errors with 10% of our users and it is something to worry about... We'll continue waiting for a solution

kiketen avatar May 25 '18 08:05 kiketen

I temporarily solved the problem on my phone (Huawei P10 Lite WAS-LX1AC432B198) following @bertam instructions. I tested for @kiketen the rebooting behaviour and I can confirm that after the rebooting I had to delete all the data and cache again in order to make it work.

danielemaddaluno avatar May 25 '18 10:05 danielemaddaluno

I have several crash reports in Firebase Crashlytics for six Huawei DLI-TL20 running Android 7.0, with almost the same stacktrace. With diferent version of Play Service, before uninstalling (clearing cache) - getting exceptions, and after installing (reinstalling) SAME version of Play Service and same app.

But there is no export button in Crashlytics console :(

since may 13 2018 every Play Service update...

 public boolean checkBarcodeDetector(Context context) {
        BarcodeDetector detector = new BarcodeDetector.Builder(context)
                .setBarcodeFormats(Barcode.DATA_MATRIX | Barcode.PDF417)
                .build();
        return detector != null && detector.isOperational();
    }

Fatal Exception: java.lang.RuntimeException Unable to resume activity {scanner.ScannerActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.android.gms.e.a.b()' on a null object reference android.app.ActivityThread.performResumeActivity (ActivityThread.java:3639) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:832) Caused by java.lang.NullPointerException

Click to expand > Attempt to invoke virtual method 'boolean com.google.android.gms.e.a.b()' on a null object reference > scanner.ScannerActivity.checkBarcodeDetector (ScannerActivity.java:550) > scanner.ScannerActivity.hasAllNecessaryCapabilities (ScannerActivity.java:509) > scanner.ScannerActivity.resumeCamera (ScannerActivity.java:436) > scanner.ScannerActivity.onResume (ScannerActivity.java:359) > android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1279) > android.app.Activity.performResume (Activity.java:7017) > android.app.ActivityThread.performResumeActivity (ActivityThread.java:3614) > android.app.ActivityThread.handleResumeActivity (ActivityThread.java:3679) > android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2879) > android.app.ActivityThread.handleRelaunchActivity (ActivityThread.java:4777) > android.app.ActivityThread.-wrap20 (ActivityThread.java) > android.app.ActivityThread$H.handleMessage (ActivityThread.java:1576) > android.os.Handler.dispatchMessage (Handler.java:105) > android.os.Looper.loop (Looper.java:156) > android.app.ActivityThread.main (ActivityThread.java:6595) > java.lang.reflect.Method.invoke (Method.java) > com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:942) > com.android.internal.os.ZygoteInit.main (ZygoteInit.java:832) > > Caused by java.lang.NullPointerException > Attempt to invoke virtual method 'boolean com.google.android.gms.e.a.b()' on a null object reference > ScannerActivity.checkBarcodeDetector (ScannerActivity.java:550)

Queue java.lang.Object.wait (Object.java) java.lang.Thread.parkFor$ (Thread.java:2142) sun.misc.Unsafe.park (Unsafe.java:325) java.util.concurrent.locks.LockSupport.park (LockSupport.java:161) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2035) java.util.concurrent.PriorityBlockingQueue.take (PriorityBlockingQueue.java:519) io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation (DependencyPriorityBlockingQueue.java:197) io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get (DependencyPriorityBlockingQueue.java:236) io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take (DependencyPriorityBlockingQueue.java:65) io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take (DependencyPriorityBlockingQueue.java:46) java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1058) java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1118) java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:607) java.lang.Thread.run (Thread.java:776)

TubeSockWriter-174 java.lang.Object.wait (Object.java) java.lang.Thread.parkFor$ (Thread.java:2142) sun.misc.Unsafe.park (Unsafe.java:325) java.util.concurrent.locks.LockSupport.park (LockSupport.java:161) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2035) java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:413) bgk.a (:com.google.android.gms.dynamite_dynamitemodulesc@[email protected] (040306-197041431):53) bgl.run (:com.google.android.gms.dynamite_dynamitemodulesc@[email protected] (040306-197041431):5) java.lang.Thread.run (Thread.java:776)

ytrikoz avatar May 27 '18 01:05 ytrikoz

Same issue in HUAWEI GR5 2017 EMUI v5.0

vasee80 avatar May 28 '18 11:05 vasee80

It seems related to #353 . So, no QR reader, no Ocr Detector, no face recognition on Huawei...

Is there another (better) place where to ask for a fix? on Google or Huawei sites?

asclepix avatar May 28 '18 13:05 asclepix

Hi i wrote here https://issuetracker.google.com/issues/80454351 maybe someone has more information about this problem pls write here anything what can be important or helpfull thx

rmasarovic avatar May 30 '18 08:05 rmasarovic

Hi All,

Is this issue resolved? I am still facing the issue. Is there any work around?

abdulsattar-sit avatar May 31 '18 05:05 abdulsattar-sit

@abdulsattar-sit no it's still open https://issuetracker.google.com/issues/80454351 Google hasn't assigned it until a few hours ago. And it has medium priority

fresswolf avatar Jun 01 '18 10:06 fresswolf

Google rep says the roll out of the fixed v12.8.62 could happen by the end of this month, with the risk of delays https://issuetracker.google.com/issues/80454351

grillermo avatar Jun 28 '18 22:06 grillermo

on my Huawei P20 Android 7.0 was problem when I tried to scan QR code with inner Android classes and that was not working. After reading the comments, I cleaned cash in all default apps of the device connected to Google Play and the scanning began to work. Haliluya!

neronovs avatar Jun 29 '18 14:06 neronovs

Is there any way to know if this bug occurs programmatically? So I can handle it in the UI?

Zachinio avatar Jul 01 '18 06:07 Zachinio

I don't know how exactly the bug occurred. Maybe, if you can clean the cash in play service apps, you can handle it. However, in moment the bug happening, I tried Zxing library for reading QR codes on the same device, and it worked. воскресенье, 01 июля 2018г., 08:02 +02:00 от ZachBublil [email protected] :

Is there any way to know if this bug occurs programmatically? So I can handle it in the UI? — You are receiving this because you commented. Reply to this email directly, view it on GitHub , or mute the thread .

neronovs avatar Jul 01 '18 07:07 neronovs

is there a possible way of making this work without having to clear cache ? i.e. could it work once Google releases an update ? (yes, got the issue as well, Huawei P10, Google Play Services v12.8.74)

hycday avatar Aug 02 '18 18:08 hycday

Google has finally released an update that solves this bug yet. The app version is 12.8.74. If you have this version of Play Services, the barcode reader should work 🗡

kiketen avatar Aug 03 '18 09:08 kiketen

I am still getting this issue in one plus 3T while trying barcode scanner in a sample app.I do have the latest google play services version 12.8.74 in my device.

ashwink94 avatar Aug 13 '18 07:08 ashwink94