syncthing / syncthing-android

Wrapper of syncthing for Android.
https://syncthing.net/
Mozilla Public License 2.0
3.59k stars 404 forks source link

Crash on api level <24 due to xing/qr-scanning #1752

Open imsodin opened 2 years ago

imsodin commented 2 years ago

We support 16 or 21 depending on the arch, but zxing only supports 24, which leads to crashes:

java.lang.NoSuchMethodError: 
  at com.google.zxing.qrcode.detector.FinderPatternFinder.selectBestPatterns (FinderPatternFinder.java:624)
  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 com.journeyapps.barcodescanner.Decoder.decode (Decoder.java:75)
  at com.journeyapps.barcodescanner.Decoder.decode (Decoder.java:49)
  at com.journeyapps.barcodescanner.DecoderThread.decode (DecoderThread.java:146)
  at com.journeyapps.barcodescanner.DecoderThread.access$000 (DecoderThread.java:22)
  at com.journeyapps.barcodescanner.DecoderThread$1.handleMessage (DecoderThread.java:38)
  at android.os.Handler.dispatchMessage (Handler.java:98)
  at android.os.Looper.loop (Looper.java:211)
  at android.os.HandlerThread.run (HandlerThread.java:61)

We should just disable it on <24

tomasz1986 commented 2 years ago

For the record, they claim to support API 19+ but require additional configuration to make it work (see https://github.com/journeyapps/zxing-android-embedded#older-sdk-versions).

progserega commented 1 year ago

Crash at try scan QR-code at android 6.0.1:

--------- beginning of crash
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): FATAL EXCEPTION: DecoderThread
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): Process: [com.nutomic.syncthingandroid](http://com.nutomic.syncthingandroid/), PID: [23594](tel:23594)
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): [java.lang.NoSuchMethodError](http://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](http://java.util.list/)' appears in /system/framework/[core-libart.jar](http://core-libart.jar/))
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): at [com.google.zxing.qrcode.detector.FinderPatternFinder.selectBestPatterns](http://com.google.zxing.qrcode.detector.finderpatternfinder.selectbestpatterns/)([FinderPatternFinder.java:624](http://finderpatternfinder.java:624/))
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): at [com.google.zxing.qrcode.detector.FinderPatternFinder.find](http://com.google.zxing.qrcode.detector.finderpatternfinder.find/)([FinderPatternFinder.java:164](http://finderpatternfinder.java:164/))
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): at [com.google.zxing.qrcode.detector.Detector.detect](http://com.google.zxing.qrcode.detector.detector.detect/)([Detector.java:81](http://detector.java:81/))
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): at [com.google.zxing.qrcode.QRCodeReader.decode](http://com.google.zxing.qrcode.qrcodereader.decode/)([QRCodeReader.java:77](http://qrcodereader.java:77/))
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): at [com.google.zxing.MultiFormatReader.decodeInternal](http://com.google.zxing.multiformatreader.decodeinternal/)([MultiFormatReader.java:173](http://multiformatreader.java:173/))
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): at [com.google.zxing.MultiFormatReader.decodeWithState](http://com.google.zxing.multiformatreader.decodewithstate/)([MultiFormatReader.java:87](http://multiformatreader.java:87/))
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): at [com.journeyapps.barcodescanner.Decoder.decode](http://com.journeyapps.barcodescanner.decoder.decode/)([Decoder.java:75](http://decoder.java:75/))
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): at [com.journeyapps.barcodescanner.Decoder.decode](http://com.journeyapps.barcodescanner.decoder.decode/)([Decoder.java:49](http://decoder.java:49/))
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): at [com.journeyapps.barcodescanner.DecoderThread.decode](http://com.journeyapps.barcodescanner.decoderthread.decode/)([DecoderThread.java:146](http://decoderthread.java:146/))
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): at [com.journeyapps.barcodescanner.DecoderThread.access](http://com.journeyapps.barcodescanner.decoderthread.access/)$[000](tel:000)([DecoderThread.java:22](http://decoderthread.java:22/))
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): at [com.journeyapps.barcodescanner.DecoderThread](http://com.journeyapps.barcodescanner.decoderthread/)$[1.handleMessage](http://1.handlemessage/)([DecoderThread.java:38](http://decoderthread.java:38/))
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): at [android.os.Handler.dispatchMessage](http://android.os.handler.dispatchmessage/)([Handler.java:98](http://handler.java:98/))
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): at [android.os.Looper.loop](http://android.os.looper.loop/)([Looper.java:148](http://looper.java:148/))
[01-16 11](tel:01-16 11):09:[40.818](tel:40.818) E/AndroidRuntime([23594](tel:23594)): at [android.os.HandlerThread.run](http://android.os.handlerthread.run/)([HandlerThread.java:61](http://handlerthread.java:61/))
[01-16 11](tel:01-16 11):09:[42.084](tel:42.084) I/SyncthingNativeCode([23594](tel:23594)): [TNGB7] INFO: New NAT port mapping: external TCP address [192.168.1.116:11402](http://192.168.1.116:11402/) to local address [::]:[22000](tel:22000).
[01-16 11](tel:01-16 11):09:[42.098](tel:42.098) I/SyncthingNativeCode([23594](tel:23594)): [TNGB7] INFO: Detected 1 NAT service
[01-16 11](tel:01-16 11):09:[45.652](tel:45.652) I/Process ([23594](tel:23594)): Sending signal. PID: [23594](tel:23594) SIG: 9
[01-16 11](tel:01-16 11):09:[46.278](tel:46.278) I/SyncthingService([31708](tel:31708)): shouldRun decision changed to true according to configured run conditions.
[01-16 11](tel:01-16 11):09:[46.279](tel:46.279) I/SyncthingService([31708](tel:31708)): Shutting down background service