microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
8.13k stars 1.69k 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 8 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 8 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 8 months ago

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

ale5000-git commented 8 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 8 months ago

There is a probable fix here: c104211

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

ale5000-git commented 8 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 7 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 7 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 3 months ago

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

Iey4iej3 commented 3 months ago

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

Axolord commented 3 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 3 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 3 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.