thunderbiscuit / padawan-wallet

The bitcoin wallet trainer on Android.
https://padawanwallet.com/
Apache License 2.0
111 stars 49 forks source link

QRCodes com.google.zxing.NotFoundException #367

Open Suraku opened 2 months ago

Suraku commented 2 months ago

Hi I've ran into an issue with QR code scanning not working on my OnePlus Nord CE 3 Lite. Exception is triggered with com.google.zxing.NotFoundException within the QRCodes.kt file.

Error

I've had no issue with my older One Plus 6T, so I'm not sure if this is a newer model phone issue?

Thought I'd have a go at trying a fix, and came across using Google's ML-Kit for barcode scanning, which looks to have done the trick.

implementation("com.google.mlkit:barcode-scanning:17.2.0")

Code snippet: MLKit

I'm not an Android developer, this is very much hacked together very roughly just as a POC to see if it fixes my issue, which it has. I'm wondering if this would be a better approach?

thunderbiscuit commented 2 months ago

Hey thanks for reporting the bug! I'm not sure what could trigger the exception. But the ML-Kit library is something I'd be interested in exploring for sure.

Would you want to open a PR for it? My only reservation would be around bundle size. It looks like the mlkit library adds 2.4 MB to your app size (something like 20% increase of Padawan), which is too bad for just needing to scan a QR code once in a while. But the xzing library is old and it's given me plenty of trouble in the past. A new solution might be nice.