microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
8.67k stars 1.73k forks source link

Implementing MLKit API (say, for scanning QR codes / barcodes) #2018

Open Iey4iej3 opened 1 year ago

Iey4iej3 commented 1 year ago

Several issues are opened due to lack of MLKit API: https://github.com/microg/GmsCore/issues/2003 https://github.com/microg/GmsCore/issues/1966 https://github.com/microg/GmsCore/issues/1881 https://github.com/microg/GmsCore/issues/1753

This is also related to https://github.com/microg/GmsCore/issues/395

I guess that the full implementation is hard, but implementing QR code / barcode scanner should be easier.

Wojtaz0w commented 1 year ago

I just wanted to mention that it is PARTIALY working, for example in DeepL translator app you can take a picture and highlight text, it gets recognised, no bugs there

Iey4iej3 commented 1 year ago

It might be better to document what (API) is working and what is yet to implement.

Rua commented 10 months ago

I currently am unable to scan QR codes with the Dutch national identification app DigID because of this problem, which locks me out of some government services. Is there any progress on this?

ltguillaume commented 10 months ago

I currently am unable to scan QR codes with the Dutch national identification app DigID because of this problem, which locks me out of some government services. Is there any progress on this?

That doesn't make any sense. DigiD recently made changes to include a library to scan QR codes, making it independent of MLKit. See https://tweakers.net/nieuws/215204/inloggen-op-digid-app-kan-voortaan-ook-op-telefoons-zonder-googles-qr-scanner.html

@Rua Are you sure you're running the latest version?

Rua commented 10 months ago

I just reinstalled the latest version (6.9.3) from the Play Store today (via Aurora).

ale5000-git commented 10 months ago

There is a probable fix here: https://github.com/microg/GmsCore/commit/c10421187b1f1f6b24c4c272d739f23227528799 But there isn't any microG release yet.

Iey4iej3 commented 10 months ago

There is a probable fix here: c104211

It might be better to link the commit to this issue.

ale5000-git commented 10 months ago

There are a lot of issues regarding this API and I'm not sure the commit fix everything, so it is better to wait the new version of microG and let the users test it before say anything else. I will provide my custom build of microG when I get my main PC working again.

konradmoesch commented 9 months ago

I am testing (gmscore master branch) with the mlkit quickstart app (https://github.com/googlesamples/mlkit/tree/master/android/vision-quickstart), which can use bundled and unbundled libraries (changeable in the gradle dependencies). It seems that the bundled dependency (com.google.mlkit:barcode-scanning) works fine, but if I change to the unbundled version, I get dynamite errors Whats the current status of this? Is somebody working on improving dynamite/mlkit support at the moment?

ale5000-git commented 9 months ago

For those that want to test here there is my custom build of microG with all fixes included: https://github.com/micro5k/microg-unofficial-installer/raw/main/zip-content/origin/priv-app/GmsCore-ale5000.apk Since it is signed by me you can't just update but you have to remove the version that you have installed before installing the new one.

licaon-kter commented 6 months ago

How far is this from being usable as a replacement for a random app that depends on Google's MLKit?

Iey4iej3 commented 6 months ago

This patch is already merged, and there are releases after the merge now. You can test yourself, I guess.

Axolord commented 5 months ago

At least https://play.google.com/store/apps/details?id=com.goodsnooze.soosee still crasges atm. I get the following crash log:

FATAL EXCEPTION: ImageAnalysis
Process: com.goodsnooze.soosee, PID: 22776
java.util.concurrent.ExecutionException: X3.a: Waiting for the text optional module to be downloaded. Please wait.
    at m3.Q2.B(Unknown Source:29)
    at s2.b.a(Unknown Source:653)
    at x.C.a(Unknown Source:2)
    at x.K.run(Unknown Source:65)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at java.lang.Thread.run(Thread.java:1012)
Caused by: X3.a: Waiting for the text optional module to be downloaded. Please wait.
    at v.e.a(Unknown Source:382)
    at E1.h0.run(Unknown Source:52)
    at k.h.run(Unknown Source:97)
    at K2.p.run(Unknown Source:28)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at K2.p.run(Unknown Source:53)
    ... 1 more
Iey4iej3 commented 5 months ago

At least https://play.google.com/store/apps/details?id=com.goodsnooze.soosee still crasges atm. I get the following crash log:

The crash log does not seem to be closely related to MLKit. Maybe https://github.com/microg/GmsCore/issues/309 is relevant?

Iey4iej3 commented 5 months ago

I tested the APP https://play.google.com/store/apps/details?id=com.davi.dev.text_detector_google_ml_kit&hl=en_US and it works.

Iey4iej3 commented 1 month ago

face recognition is not supported yet.

Local module descriptor class for com.google.mlkit.dynamite.face not found.

Error preloading model resource com.google.mlkit.common.MlKitException: Waiting for the face module to be downloaded. Please wait. at com.google.mlkit.vision.face.internal.zza.zzd(Unknown Source:111) at com.google.mlkit.vision.face.internal.zzh.load(Unknown Source:3) at com.google.mlkit.common.sdkinternal.ModelResource.zza(Unknown Source:18) at com.google.mlkit.common.sdkinternal.zzn.run(Unknown Source:10) at com.google.mlkit.common.sdkinternal.zzt.run(Unknown Source:12) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zze(Unknown Source:13) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzc(Unknown Source:8) at com.google.mlkit.common.sdkinternal.zzk.run(Unknown Source:2) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzd(Unknown Source:10) at com.google.mlkit.common.sdkinternal.zzi.run(Unknown Source:2) at java.lang.Thread.run(Thread.java:1012) Caused by: com.google.android.gms.dynamite.DynamiteModule$LoadingException: No acceptable module com.google.android.gms.vision.face found. Local version is 0 and remote version is 0. at com.google.android.gms.dynamite.DynamiteModule.load(Unknown Source:693) at com.google.mlkit.vision.face.internal.zza.zze(Unknown Source:2) at com.google.mlkit.vision.face.internal.zza.zzg(Unknown Source:21) at com.google.mlkit.vision.face.internal.zza.zzf(Unknown Source:154) at com.google.mlkit.vision.face.internal.zza.zzd(Unknown Source:49) ... 12 more