From d89e49ac782e8b6da31b7eefaf59e8c622ac16a5 Mon Sep 17 00:00:00 2001 From: Peter Sanford Date: Fri, 27 Dec 2024 09:52:30 -0800 Subject: [PATCH] Upgrade zxing library This is needed to be able to perform fresh builds. jcenter is gone which means we can't fetch our older zxing dependency anymore. zxing now requires androidx so use that for the compat library. The docs for zxing say that this version requires at least sdk 24 so bump our min version to that. Closes: #46 [via git-merge-pr] --- android/build.gradle | 11 +++++------ android/gradle.properties | 2 ++ .../main/java/io/sanford/wormholewilliam/Scan.java | 3 +-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 37accd9..3d87630 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,7 +1,7 @@ buildscript { repositories { google() - jcenter() + mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:7.4.2' @@ -11,7 +11,7 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() flatDir { dirs 'libs' } @@ -26,7 +26,7 @@ android { buildToolsVersion "33.0.2" compileSdkVersion 30 defaultConfig { - minSdkVersion 22 + minSdkVersion 24 targetSdkVersion 34 versionCode 18 versionName "1.0.13" @@ -39,7 +39,6 @@ android { dependencies { implementation ':wormhole-william@aar' - implementation 'com.android.support:appcompat-v7:26.1.0' - implementation 'com.google.zxing:core:3.2.1' - implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar' + implementation 'androidx.appcompat:appcompat:1.3.1' + implementation 'com.journeyapps:zxing-android-embedded:4.3.0' } diff --git a/android/gradle.properties b/android/gradle.properties index e69de29..ccaba61 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -0,0 +1,2 @@ +android.useAndroidX=true + diff --git a/android/src/main/java/io/sanford/wormholewilliam/Scan.java b/android/src/main/java/io/sanford/wormholewilliam/Scan.java index 22ad861..7a3efa7 100644 --- a/android/src/main/java/io/sanford/wormholewilliam/Scan.java +++ b/android/src/main/java/io/sanford/wormholewilliam/Scan.java @@ -32,9 +32,8 @@ public void run() { @Override public void onAttach(Context ctx) { super.onAttach(ctx); - IntentIntegrator integrator = IntentIntegrator.forFragment(this); - integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES); + integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE); integrator.setPrompt("Scan"); integrator.setCameraId(0); integrator.setBeepEnabled(false);