Use desugaring to upgrade zxing without having to increase minSdk

As documented by the zxing team on https://github.com/zxing/zxing/wiki/Frequently-Asked-Questions#it-doesnt-work-with-java-7--no-interface-method-sortljavautilcomparator
This commit is contained in:
Sylvia van Os
2021-07-28 23:05:27 +02:00
parent 96bc10583f
commit cbcf1bcd99
2 changed files with 9 additions and 6 deletions

View File

@@ -22,6 +22,7 @@ android {
versionName "2.0.4"
vectorDrawables.useSupportLibrary true
multiDexEnabled true
}
buildTypes {
@@ -38,6 +39,10 @@ android {
compileOptions {
encoding "UTF-8"
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
@@ -74,12 +79,11 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.preference:preference:1.1.1'
implementation 'com.google.android.material:material:1.4.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
// Third-party
implementation 'com.journeyapps:zxing-android-embedded:4.1.0@aar'
// Do not upgrade past 3.3.3! Causes a crash on versions before Android Nougat
//noinspection GradleDependency
implementation 'com.google.zxing:core:3.3.3'
implementation 'com.google.zxing:core:3.4.1'
implementation 'org.apache.commons:commons-csv:1.8'
implementation 'com.jaredrummler:colorpicker:1.1.0'
implementation 'com.google.guava:guava:30.1.1-jre'

View File

@@ -1,11 +1,10 @@
package protect.card_locker;
import android.app.Application;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.multidex.MultiDexApplication;
import protect.card_locker.preferences.Settings;
public class LoyaltyCardLockerApplication extends Application {
public class LoyaltyCardLockerApplication extends MultiDexApplication {
public void onCreate() {
super.onCreate();