GmsCore icon indicating copy to clipboard operation
GmsCore copied to clipboard

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

Open Iey4iej3 opened this issue 2 years ago • 16 comments

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.

Iey4iej3 avatar Aug 27 '23 21:08 Iey4iej3

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

Wojtaz0w avatar Aug 28 '23 20:08 Wojtaz0w

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

Iey4iej3 avatar Aug 30 '23 13:08 Iey4iej3

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?

Rua avatar Jan 10 '24 14:01 Rua

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?

ltguillaume avatar Jan 10 '24 15:01 ltguillaume

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

Rua avatar Jan 10 '24 15:01 Rua

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

ale5000-git avatar Jan 10 '24 21:01 ale5000-git

There is a probable fix here: c104211

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

Iey4iej3 avatar Jan 10 '24 21:01 Iey4iej3

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.

ale5000-git avatar Jan 10 '24 21:01 ale5000-git

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?

konradmoesch avatar Feb 03 '24 21:02 konradmoesch

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.

ale5000-git avatar Feb 07 '24 13:02 ale5000-git

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

licaon-kter avatar May 20 '24 08:05 licaon-kter

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

Iey4iej3 avatar May 20 '24 12:05 Iey4iej3

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

axodentally avatar May 27 '24 07:05 axodentally

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 avatar May 27 '24 17:05 Iey4iej3

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 avatar May 27 '24 17:05 Iey4iej3