vision-camera-code-scanner icon indicating copy to clipboard operation
vision-camera-code-scanner copied to clipboard

fix __scanCodes is not defined and upgrade libs to work with react-native 0.71.2

Open EstebanFuentealba opened this issue 2 years ago • 7 comments

I updated the packages to work with the latest version of react-native (0.71.2) and the latest version of react-native-vision-camera (2.15.4). Also fixed the problem of __scanCodes is not defined which closes issues #121 #112 #107 #106

EstebanFuentealba avatar Feb 07 '23 01:02 EstebanFuentealba

I also patched react-native-vision-camera (2.15.4) to work with the latest version of react-native (0.71.2)

diff --git a/node_modules/react-native-vision-camera/android/build.gradle b/node_modules/react-native-vision-camera/android/build.gradle
index 91e64d9..a76e3c0 100644
--- a/node_modules/react-native-vision-camera/android/build.gradle
+++ b/node_modules/react-native-vision-camera/android/build.gradle
@@ -79,7 +79,7 @@ buildscript {
   }
 
   dependencies {
-    classpath 'com.android.tools.build:gradle:4.2.2'
+    classpath("com.android.tools.build:gradle:7.3.1")
     classpath 'de.undercouch:gradle-download-task:4.1.2'
     // noinspection DifferentKotlinGradleVersion
     classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
diff --git a/node_modules/react-native-vision-camera/android/gradle.properties b/node_modules/react-native-vision-camera/android/gradle.properties
index d171611..a61e78e 100644
--- a/node_modules/react-native-vision-camera/android/gradle.properties
+++ b/node_modules/react-native-vision-camera/android/gradle.properties
@@ -11,10 +11,10 @@
 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
 # org.gradle.parallel=true
 #Fri Feb 19 20:46:14 CET 2021
-VisionCamera_buildToolsVersion=30.0.0
-VisionCamera_compileSdkVersion=31
-VisionCamera_kotlinVersion=1.5.30
-VisionCamera_targetSdkVersion=31
-VisionCamera_ndkVersion=21.4.7075529
+VisionCamera_buildToolsVersion=33.0.0
+VisionCamera_compileSdkVersion=33
+VisionCamera_kotlinVersion=1.6.20
+VisionCamera_targetSdkVersion=33
+VisionCamera_ndkVersion=23.1.7779620
 android.enableJetifier=true
 android.useAndroidX=true

EstebanFuentealba avatar Feb 07 '23 01:02 EstebanFuentealba

What is the ETA on this fix? Would be really useful

LonguCodes avatar Feb 10 '23 16:02 LonguCodes

@EstebanFuentealba I am experiencing an issue with building with the vision-camera-code-scanner as well. Were using ^0.71.1 and the latest react-native-vision-camera (2.15.4), which requires kotlin version 1.6.20. Also in order to use vision-camera-code-scanner we need the latest react-native-reanimated (2.14.4), which i suspect is incompatible with the latest react-native-reanimated (2.3.0-beta.2) under the devDependencies of the node modules of react-native-vision-camera.

We are getting this error, which loops 100 times:

CMake Warning at C:/Users/DanielGannage/AppData/Local/Android/Sdk/ndk/23.1.7779620/build/cmake/android-legacy.toolchain.cmake:416 (message):
    An old version of CMake is being used that cannot automatically detect
    compiler attributes.  Compiler identification is being bypassed.  Some
    values may be wrong or missing.  Update to CMake 3.19 or newer to use
    CMake's built-in compiler identification.
  Call Stack (most recent call first):
    C:/Users/DanielGannage/AppData/Local/Android/Sdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake:55 (include)
    .cxx/Debug/6b4v6r4w/armeabi-v7a/CMakeFiles/3.18.1-g262b901-dirty/CMakeSystem.cmake:6 (include)
    CMakeLists.txt:1 (project)


  CMake Warning at CMakeLists.txt:250 (message):
    VisionCamera linking: FOR_HERMES=true


  ninja: error: manifest 'build.ninja' still dirty after 100 tries

A fresh project will run with the latest React Native, the latest react-native-vision-camera and the latest vision-camera-code-scanner, but as soon as you add react-native-reanimated it fails.

The syntax babel.config.js plugin may have something to do with it as well. I cant be sure just yet.

DanielGannage avatar Feb 14 '23 22:02 DanielGannage

Solved my problem!

luisgustavofin avatar Mar 29 '23 23:03 luisgustavofin

This works for me too. Any chance it can be merged?

"react-native": "0.71.7",
"react-native-reanimated": "2.14.4",
"react-native-vision-camera": "2.15.4",
"vision-camera-code-scanner": "https://github.com/EstebanFuentealba/vision-camera-code-scanner.git",

dominictobias avatar Apr 24 '23 21:04 dominictobias

@EstebanFuentealba much appreciated. I created a working example based on your changes.

franzos avatar May 11 '23 20:05 franzos

When can this be merged?

qoobes avatar May 18 '23 17:05 qoobes