Comments (6)
I addressed the issues using patch-package, the google mlkit dependency route changed and I also made some updates to the Android SDK versions and dependency versions for compatibility:
diff --git a/node_modules/vision-camera-code-scanner/android/build.gradle b/node_modules/vision-camera-code-scanner/android/build.gradle
index b6bd964..4567cfb 100644
--- a/node_modules/vision-camera-code-scanner/android/build.gradle
+++ b/node_modules/vision-camera-code-scanner/android/build.gradle
@@ -18,11 +18,11 @@ def safeExtGet(prop, fallback) {
}
android {
- compileSdkVersion safeExtGet('VisionCameraCodeScanner_compileSdkVersion', 30)
+ compileSdkVersion safeExtGet('compileSdkVersion', 30)
ndkVersion "21.4.7075529"
defaultConfig {
- minSdkVersion safeExtGet('VisionCameraCodeScanner_minSdkVersion', 21)
- targetSdkVersion safeExtGet('VisionCameraCodeScanner_targetSdkVersion', 31)
+ minSdkVersion safeExtGet('minSdkVersion', 21)
+ targetSdkVersion safeExtGet('targetSdkVersion', 31)
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.1.0-alpha08"
+ implementation 'com.google.mlkit:barcode-scanning:17.0.2'
}
diff --git a/node_modules/vision-camera-code-scanner/android/src/main/java/com/visioncameracodescanner/BarcodeConverter.java b/node_modules/vision-camera-code-scanner/android/src/main/java/com/visioncameracodescanner/BarcodeConverter.java
index 74e208b..eb4ed07 100644
--- a/node_modules/vision-camera-code-scanner/android/src/main/java/com/visioncameracodescanner/BarcodeConverter.java
+++ b/node_modules/vision-camera-code-scanner/android/src/main/java/com/visioncameracodescanner/BarcodeConverter.java
@@ -7,7 +7,7 @@ import androidx.annotation.NonNull;
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/node_modules/vision-camera-code-scanner/android/src/main/java/com/visioncameracodescanner/VisionCameraCodeScannerPlugin.java b/node_modules/vision-camera-code-scanner/android/src/main/java/com/visioncameracodescanner/VisionCameraCodeScannerPlugin.java
index 8198564..a3adafd 100644
--- a/node_modules/vision-camera-code-scanner/android/src/main/java/com/visioncameracodescanner/VisionCameraCodeScannerPlugin.java
+++ b/node_modules/vision-camera-code-scanner/android/src/main/java/com/visioncameracodescanner/VisionCameraCodeScannerPlugin.java
@@ -24,7 +24,7 @@ import androidx.camera.core.ImageProxy;
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;
from vision-camera-code-scanner.
Same error
from vision-camera-code-scanner.
I am having the same error
from vision-camera-code-scanner.
@SirFitz Thanks for help. I was also facing same issue.
Also for me only updating below fixed the issue.
implementation 'com.google.mlkit:barcode-scanning:17.0.0'
to implementation 'com.google.mlkit:barcode-scanning:17.0.2'
in build.gradle
and
Its imports in BarcodeConverter.java and VisionCameraCodeScannerPlugin.java
import com.google.mlkit.vision.barcode.Barcode;
to import com.google.mlkit.vision.barcode.common.Barcode;
from vision-camera-code-scanner.
Why not creating a PR for the patch?
from vision-camera-code-scanner.
@OnurGuersoy This issue is project specific. I guess.
As for one of my projects this was happening and applying above fix resolved it.
But when i tried same on react native boilerplate repo with same versions( of react-native, vision-camera, reanimated and code-scanner-plugin), there it was working fine.
So, not sure if PR is even required for patch.
from vision-camera-code-scanner.
Related Issues (20)
- XCode build failure with "ld: symbol(s) not found for architecture arm64" HOT 10
- Should we create a new public fork for this repository? HOT 8
- ERROR ReferenceError: Can't find variable: _setGlobalConsole HOT 3
- Canβt recognize the QR code of Etherscan. HOT 2
- Does not work. Doesn't recognize QR code HOT 8
- Could not build Objective-C module 'vision_camera_code_scanner' HOT 9
- The camera flickers when using frameProcessor HOT 1
- Warning: Can't perform a React state update on an unmounted component. HOT 2
- Add Auto zoom to Scan QR code HOT 1
- Port to react-native-vision-camera v3 HOT 10
- Unable to build with Vision Camera 3.0.0-rc4 HOT 29
- Failed to build in Apple M1 HOT 4
- DO NOT USE THIS LIBRARY, THIS DOES NOT WORK AT ALL HOT 6
- This Package needs update to support RNVC v3 HOT 4
- MRZ Scan ? HOT 2
- Crashes on startup on Xcode 15 HOT 7
- Problem with react native vision camera v3 HOT 7
- ERROR Frame Processor threw an error: Property '__scanOCR' doesn't exist HOT 2
- [ios] Crash when app reloads
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vision-camera-code-scanner.