Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Upgraded dependencies. Fixes Android after RN 0.71 upgrade #133

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath("com.android.tools.build:gradle:7.3.1")
}
}
}
Expand All @@ -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"

Expand Down Expand Up @@ -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'
}
5 changes: 3 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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[]
{
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down