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

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

EstebanFuentealba
Copy link

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
Copy link
Author

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 EstebanFuentealba changed the title Upgrade libs and fix __scanCodes is not defined fix __scanCodes is not defined and upgrade libs Feb 7, 2023
@EstebanFuentealba EstebanFuentealba changed the title fix __scanCodes is not defined and upgrade libs fix __scanCodes is not defined and upgrade libs to work with react-native 0.71.2 Feb 7, 2023
@LonguCodes
Copy link

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

@DanielGannage
Copy link

@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.

@luisgustavofin
Copy link

Solved my problem!

@dominictobias
Copy link

dominictobias commented Apr 24, 2023

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",

@franzos
Copy link

franzos commented May 11, 2023

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

@qoobes
Copy link

qoobes commented May 18, 2023

When can this be merged?

dayaki added a commit to dayaki/vision-camera-code-scanner that referenced this pull request May 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants