diff --git a/android/build.gradle b/android/build.gradle index b6bd964..ebe35d2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.2.1' + classpath("com.android.tools.build:gradle:7.3.1") } } } @@ -18,11 +18,11 @@ def safeExtGet(prop, fallback) { } android { - compileSdkVersion safeExtGet('VisionCameraCodeScanner_compileSdkVersion', 30) - ndkVersion "21.4.7075529" + compileSdkVersion safeExtGet('VisionCameraCodeScanner_compileSdkVersion', 33) + ndkVersion = "23.1.7779620" defaultConfig { minSdkVersion safeExtGet('VisionCameraCodeScanner_minSdkVersion', 21) - targetSdkVersion safeExtGet('VisionCameraCodeScanner_targetSdkVersion', 31) + targetSdkVersion safeExtGet('VisionCameraCodeScanner_targetSdkVersion', 33) versionCode 1 versionName "1.0" @@ -56,6 +56,6 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules api project(":react-native-vision-camera") - implementation "androidx.camera:camera-core:1.1.0-alpha06" - implementation 'com.google.mlkit:barcode-scanning:17.0.0' + implementation "androidx.camera:camera-core:1.2.1" + implementation 'com.google.mlkit:barcode-scanning:17.0.3' } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index da9702f..165db0c 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Tue Mar 07 14:30:45 CST 2023 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/android/src/main/java/com/visioncameracodescanner/BarcodeConverter.java b/android/src/main/java/com/visioncameracodescanner/BarcodeConverter.java index 74e208b..eb4ed07 100644 --- a/android/src/main/java/com/visioncameracodescanner/BarcodeConverter.java +++ b/android/src/main/java/com/visioncameracodescanner/BarcodeConverter.java @@ -7,7 +7,7 @@ import com.facebook.react.bridge.WritableNativeArray; import com.facebook.react.bridge.WritableNativeMap; -import com.google.mlkit.vision.barcode.Barcode; +import com.google.mlkit.vision.barcode.common.Barcode; import java.util.List; diff --git a/android/src/main/java/com/visioncameracodescanner/VisionCameraCodeScannerPlugin.java b/android/src/main/java/com/visioncameracodescanner/VisionCameraCodeScannerPlugin.java index 8198564..29816f6 100644 --- a/android/src/main/java/com/visioncameracodescanner/VisionCameraCodeScannerPlugin.java +++ b/android/src/main/java/com/visioncameracodescanner/VisionCameraCodeScannerPlugin.java @@ -24,7 +24,7 @@ import com.google.android.gms.tasks.Tasks; import com.mrousavy.camera.frameprocessor.FrameProcessorPlugin; import com.google.android.gms.tasks.Task; -import com.google.mlkit.vision.barcode.Barcode; +import com.google.mlkit.vision.barcode.common.Barcode; import com.google.mlkit.vision.barcode.BarcodeScanner; import com.google.mlkit.vision.barcode.BarcodeScanning; import com.google.mlkit.vision.barcode.BarcodeScannerOptions; @@ -219,17 +219,17 @@ private WritableNativeMap convertBarcode(@NonNull Barcode barcode) { // Bitmap Inversion https://gist.github.com/moneytoo/87e3772c821cb1e86415 private Bitmap invert(Bitmap src) - { + { int height = src.getHeight(); - int width = src.getWidth(); + int width = src.getWidth(); Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); Paint paint = new Paint(); - + ColorMatrix matrixGrayscale = new ColorMatrix(); matrixGrayscale.setSaturation(0); - + ColorMatrix matrixInvert = new ColorMatrix(); matrixInvert.set(new float[] { @@ -239,10 +239,10 @@ private Bitmap invert(Bitmap src) 0.0f, 0.0f, 0.0f, 1.0f, 0.0f }); matrixInvert.preConcat(matrixGrayscale); - + ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrixInvert); paint.setColorFilter(filter); - + canvas.drawBitmap(src, 0, 0, paint); return bitmap; } diff --git a/package.json b/package.json index 2bdb4bc..289da10 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ }, "devDependencies": { "react-native-reanimated": "2.4.1", - "react-native-vision-camera": "^2.9.4", + "react-native-vision-camera": "^2.15.4", "@commitlint/config-conventional": "^11.0.0", "@react-native-community/eslint-config": "^2.0.0", "@release-it/conventional-changelog": "^2.0.0",