microg / microg/GmsCore

[be.ugent.zeus.hydra] Barcode scanner does not work (com.google.mlkit.common.MlKitException)

Open
#1,753 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

📸 Vision
Dominant language
Java
Stars
14.6k
Forks
3.2k
Avg merge
12d 11h
Merged PRs (30d)
4

Description

Affected app
Name: Hydra
Package id: be.ugent.zeus.hydra

Describe the bug

When tapping the barcode scan button, it shows a toast with 'Network failure' and the following logs show up in logcat:

07-28 22:58:31.336 10700 10700 E FormActivity: Error while getting data.
07-28 22:58:31.336 10700 10700 E FormActivity: com.google.mlkit.common.MlKitException: Code scanner module is not supported on current Google Play Services version, please upgrade.
07-28 22:58:31.336 10700 10700 E FormActivity:     at be.ugent.zeus.hydra.common.barcode.GoogleBarcodeScanner.getBarcode(GoogleBarcodeScanner.java:42)
07-28 22:58:31.336 10700 10700 E FormActivity:     at be.ugent.zeus.hydra.wpi.tap.cart.CartActivity.lambda$onCreate$0(CartActivity.java:5)
07-28 22:58:31.336 10700 10700 E FormActivity:     at be.ugent.zeus.hydra.wpi.tap.cart.CartActivity.n(Unknown Source:0)
07-28 22:58:31.336 10700 10700 E FormActivity:     at be.ugent.zeus.hydra.feed.cards.event.a.onClick(Unknown Source:18)
07-28 22:58:31.336 10700 10700 E FormActivity:     at android.view.View.performClick(View.java:7455)
07-28 22:58:31.336 10700 10700 E FormActivity:     at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:2)
07-28 22:58:31.336 10700 10700 E FormActivity:     at android.view.View.performClickInternal(View.java:7432)
07-28 22:58:31.336 10700 10700 E FormActivity:     at android.view.View.access$3700(View.java:835)
07-28 22:58:31.336 10700 10700 E FormActivity:     at android.view.View$PerformClick.run(View.java:28810)
07-28 22:58:31.336 10700 10700 E FormActivity:     at android.os.Handler.handleCallback(Handler.java:938)
07-28 22:58:31.336 10700 10700 E FormActivity:     at android.os.Handler.dispatchMessage(Handler.java:99)
07-28 22:58:31.336 10700 10700 E FormActivity:     at android.os.Looper.loopOnce(Looper.java:201)
07-28 22:58:31.336 10700 10700 E FormActivity:     at android.os.Looper.loop(Looper.java:288)
07-28 22:58:31.336 10700 10700 E FormActivity:     at android.app.ActivityThread.main(ActivityThread.java:7870)
07-28 22:58:31.336 10700 10700 E FormActivity:     at java.lang.reflect.Method.invoke(Native Method)
07-28 22:58:31.336 10700 10700 E FormActivity:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
07-28 22:58:31.336 10700 10700 E FormActivity:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Settings', 'About'
  2. Tap 'Made by Zeus WPI' twice to unlock Zeus mode
  3. Exit 'Settings', go to the new 'Zeus mode' entry
  4. Fill in credentials in 'Manage login data' in the top right of the app
  5. Press 'Order', then 'Scan'
  6. It now logs com.google.mlkit.common.MlKitException: Code scanner module is not supported on current Google Play Services version, please upgrade. in logcat

Expected behavior

I expect a barcode reader window to show, letting me scan barcodes

System
Android Version: 12
Custom ROM: LineageOS 19.1 MicroG

microG
microG Core version: 0.2.24.214816
microG Self-Check results: All ticked

Additional context

The app is open-source, that might make testing easier. See https://github.com/ZeusWPI/hydra-android

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the scan flow on Android 12 with microG 0.2.24.214816, then inspect the reported GoogleBarcodeScanner.java:42 failure and its CartActivity.java:5 call site. Trace the Play Services compatibility path and verify that tapping Scan opens a barcode reader window instead of showing the network-failure toast.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.