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

Does not read the QR on Huawei devices #352

Open danielemaddaluno opened 6 years ago

danielemaddaluno commented 6 years ago

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)

auto-ororo commented 6 years ago

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.

x51811danny commented 6 years ago

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

VEIKKO99 commented 6 years ago

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)

sattha commented 6 years ago

+1

Huawei GR5 2017 (Premium) Android Version 7.0

sattha commented 6 years ago

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.

algibe commented 6 years ago

Not working for me this workaround

sattha commented 6 years ago

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" /> 
kiketen commented 6 years ago

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?

rdoubleui commented 6 years ago

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.

andreasciarra commented 6 years ago

Same problem on Huawei P10 Lite

ngallazzi commented 6 years ago

Same problem on Huawei P9 Lite and on Huawei P20

rdoubleui commented 6 years ago

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

elekiwi commented 6 years ago

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.

kiketen commented 6 years ago

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...

elekiwi commented 6 years ago

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

kiketen commented 6 years ago

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

danielemaddaluno commented 6 years ago

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.

ytrikoz commented 6 years ago

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@12685021@12.6.85 (040306-197041431):53) bgl.run (:com.google.android.gms.dynamite_dynamitemodulesc@12685021@12.6.85 (040306-197041431):5) java.lang.Thread.run (Thread.java:776)
vasee80 commented 6 years ago

Same issue in HUAWEI GR5 2017 EMUI v5.0

asclepix commented 6 years ago

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?

rmasarovic commented 6 years ago

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

abdulsattar-sit commented 6 years ago

Hi All,

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

fresswolf commented 6 years ago

@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

grillermo commented 6 years ago

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

neronovs commented 6 years ago

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!

Zachinio commented 6 years ago

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

neronovs commented 6 years ago

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 notifications@github.com :

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 .

hycday commented 6 years ago

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)

kiketen commented 6 years ago

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 🗡

ashwink94 commented 6 years ago

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.

Goncharuk-Nikita commented 6 years ago

Yes, I have the same problem. I also use Xamarin.GooglePlayServices.Vision, on the phone of Huawei everything is working fine, but on the tablet Huawei does not work.

AnthonyJoshua1 commented 5 years ago

Facing issue on Huawei y6

grillermo commented 5 years ago

Still happening on play services 16.0.89

Dak2896 commented 5 years ago

No progress on this issue, i have it on Huawei P9 Lite L31

grillermo commented 5 years ago

My solution has been to update google play services, then delete the failing app, then restart the device then reinstall the app. It even works if you update to beta versions, get them from here: https://www.apkmirror.com/?post_type=app_release&searchtype=apk&s=google+play+services And don't forget to disable google play services automatic updates or it will break your app again.