dm77 / barcodescanner

Barcode Scanner Libraries for Android
Other
5.46k stars 1.42k forks source link

Crash in api < 24 #508

Closed juandallaglio closed 4 years ago

juandallaglio commented 4 years ago

Hi,

i have this crash when read a qr code with a camera, is the same code that example FullScannerActivity.java

`AndroidRuntime: FATAL EXCEPTION: CameraHandlerThread

java.lang.NoSuchMethodError: No interface method sort(Ljava/util/Comparator;)V in class Ljava/util/List; or its super classes (declaration of 'java.util.List' appears in /system/framework/core-libart.jar)
    at com.google.zxing.qrcode.detector.FinderPatternFinder.selectBestPatterns(FinderPatternFinder.java:616)
    at com.google.zxing.qrcode.detector.FinderPatternFinder.find(FinderPatternFinder.java:164)
    at com.google.zxing.qrcode.detector.Detector.detect(Detector.java:81)
    at com.google.zxing.qrcode.QRCodeReader.decode(QRCodeReader.java:77)
    at com.google.zxing.MultiFormatReader.decodeInternal(MultiFormatReader.java:173)
    at com.google.zxing.MultiFormatReader.decodeWithState(MultiFormatReader.java:87)
    at me.dm7.barcodescanner.zxing.ZXingScannerView.onPreviewFrame(ZXingScannerView.java:125)
    at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1183)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.os.HandlerThread.run(HandlerThread.java:61)

`

I read over the problem, and this is because the lib zxing:core use Java 8 and this is not support in api < 24. The solution is compiler zxing:core version 3.3.3.

It's possible?

or exist other implementation?

Thank you.

juandallaglio commented 4 years ago

or which version of this lib use zxing:core 3.3.3?

jnischler commented 4 years ago

Hey,

we are also facing this problem.

this is caused by this issue https://github.com/zxing/zxing/issues/1170 Problem starts with version 3.4.0+

But this library ist using 3.3.3 So the Problem should not happen.

https://github.com/dm77/barcodescanner/blob/master/dependencies.gradle

Did i miss something ?

regards

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.