Fix: QR scanning issues on API below 24.

This had to do with the zebra crossing (zxing) library using a Java 8 sorted API that is not available until Android API 24. The previous fix was to revert to an older version of zxing but now R8/D8 allows for desugaring so that the sort API now works.
This commit is contained in:
Kevin Gorham 2021-05-26 10:04:47 -04:00
parent 44d10dad73
commit b78bd5c5f1
No known key found for this signature in database
GPG Key ID: CCA55602DF49FC38
2 changed files with 5 additions and 0 deletions

View File

@ -78,6 +78,8 @@ android {
}
}
compileOptions {
// emable support for new langauge APIs but also fix the issue with zxing on API < 24
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
@ -146,6 +148,8 @@ dependencies {
implementation Deps.AndroidX.Navigation.UI_KTX
implementation Deps.AndroidX.Room.ROOM_KTX
kapt Deps.AndroidX.Room.ROOM_COMPILER
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
// Google
implementation Deps.Google.GUAVA

View File

@ -44,6 +44,7 @@ class QrAnalyzer(val scanCallback: (qrContent: String, image: ImageProxy) -> Uni
null
} catch (e: Throwable) {
twig("Error while scanning QR: $e")
twig(e)
null
}
}