Comments (10)
Actually should be:
diff --git a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt
index d697bef..8de418b 100644
--- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt
+++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt
@@ -7,12 +7,14 @@ import com.facebook.jni.HybridData
import com.facebook.proguard.annotations.DoNotStrip
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.UiThreadUtil
+import com.facebook.react.common.annotations.FrameworkAPI
import com.facebook.react.turbomodule.core.CallInvokerHolderImpl
import com.facebook.react.uimanager.UIManagerHelper
import com.mrousavy.camera.core.ViewNotFoundError
import com.mrousavy.camera.react.CameraView
import java.lang.ref.WeakReference
+@OptIn(FrameworkAPI::class)
@Suppress("KotlinJniMissingFunction") // we use fbjni.
class VisionCameraProxy(private val reactContext: ReactApplicationContext) {
companion object {
Need to add the first lines
from react-native-vision-camera.
@danieloprado the patch does not include the FrameworkAPI
import, proper patch:
--- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt
+++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt
@@ -7,12 +7,14 @@ import com.facebook.jni.HybridData
import com.facebook.proguard.annotations.DoNotStrip
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.UiThreadUtil
+import com.facebook.react.common.annotations.FrameworkAPI
import com.facebook.react.turbomodule.core.CallInvokerHolderImpl
import com.facebook.react.uimanager.UIManagerHelper
import com.mrousavy.camera.core.ViewNotFoundError
import com.mrousavy.camera.react.CameraView
import java.lang.ref.WeakReference
+@OptIn(FrameworkAPI::class)
@Suppress("KotlinJniMissingFunction") // we use fbjni.
class VisionCameraProxy(private val reactContext: ReactApplicationContext) {
companion object {
from react-native-vision-camera.
A simple workaround using patch-package:
react-native-vision-camera+4.0.3.patch
diff --git a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt
index d697bef..3e149f1 100644
--- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt
+++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt
@@ -13,6 +13,7 @@ import com.mrousavy.camera.core.ViewNotFoundError
import com.mrousavy.camera.react.CameraView
import java.lang.ref.WeakReference
+@OptIn(FrameworkAPI::class)
@Suppress("KotlinJniMissingFunction") // we use fbjni.
class VisionCameraProxy(private val reactContext: ReactApplicationContext) {
companion object {
It's not a definitive solution, it just a workaround to able to compile this on react-native 74
from react-native-vision-camera.
Actually should be:
diff --git a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt index d697bef..8de418b 100644 --- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt +++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt @@ -7,12 +7,14 @@ import com.facebook.jni.HybridData import com.facebook.proguard.annotations.DoNotStrip import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.UiThreadUtil +import com.facebook.react.common.annotations.FrameworkAPI import com.facebook.react.turbomodule.core.CallInvokerHolderImpl import com.facebook.react.uimanager.UIManagerHelper import com.mrousavy.camera.core.ViewNotFoundError import com.mrousavy.camera.react.CameraView import java.lang.ref.WeakReference +@OptIn(FrameworkAPI::class) @Suppress("KotlinJniMissingFunction") // we use fbjni. class VisionCameraProxy(private val reactContext: ReactApplicationContext) { companion object {Need to add the first lines
Good afternoon, how can I implement this solution that you mention?
Create a file at patches/react-native-vision-camera+4.0.3.patch, then install patch-package
from react-native-vision-camera.
Hey - this is a duplicate of #2614.
New architecture support (which also implies react-native 0.74 support) is tracked in that issue. If you need this, please sponsor the issue/fund the development of that major refactor/migration by donating to the Polar pool mentioned in the issue above.
Thank you.
from react-native-vision-camera.
oops, failed copy paste :face_palm:, thanks @danieloprado
from react-native-vision-camera.
0.74 is not supported yet AFAIK.
from react-native-vision-camera.
Actually should be:
diff --git a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt index d697bef..8de418b 100644 --- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt +++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt @@ -7,12 +7,14 @@ import com.facebook.jni.HybridData import com.facebook.proguard.annotations.DoNotStrip import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.UiThreadUtil +import com.facebook.react.common.annotations.FrameworkAPI import com.facebook.react.turbomodule.core.CallInvokerHolderImpl import com.facebook.react.uimanager.UIManagerHelper import com.mrousavy.camera.core.ViewNotFoundError import com.mrousavy.camera.react.CameraView import java.lang.ref.WeakReference +@OptIn(FrameworkAPI::class) @Suppress("KotlinJniMissingFunction") // we use fbjni. class VisionCameraProxy(private val reactContext: ReactApplicationContext) { companion object {Need to add the first lines
Good afternoon, how can I implement this solution that you mention?
from react-native-vision-camera.
I've added the two lines on line 10 and line 17 but I'm still getting another error
from react-native-vision-camera.
Actually should be:
diff --git a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt index d697bef..8de418b 100644 --- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt +++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt @@ -7,12 +7,14 @@ import com.facebook.jni.HybridData import com.facebook.proguard.annotations.DoNotStrip import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.UiThreadUtil +import com.facebook.react.common.annotations.FrameworkAPI import com.facebook.react.turbomodule.core.CallInvokerHolderImpl import com.facebook.react.uimanager.UIManagerHelper import com.mrousavy.camera.core.ViewNotFoundError import com.mrousavy.camera.react.CameraView import java.lang.ref.WeakReference +@OptIn(FrameworkAPI::class) @Suppress("KotlinJniMissingFunction") // we use fbjni. class VisionCameraProxy(private val reactContext: ReactApplicationContext) { companion object {Need to add the first lines
Hi, im facing this issue cuz some library broke our project (we dont know which one) and we're forced to update RN :S
Using yarn patch im getting this error, does anyone knows why?
YN0000: Β· Yarn 4.2.2
β€ YN0000: β Resolution step
β€ YN0001: β Error: react-native-vision-camera@patch:react-native-vision-camera@npm%3A4.0.5#~/.yarn/patches/react-native-vision-camera-npm-4.0.5-0f2bdc9daa.patch: hunk header integrity check failed (expected @@ +0 +10 @@, got @@ +0 +1 @@)
at $vt (/Users/rxmvnld/.yarn/releases/yarn-4.2.2.cjs:704:7821)
at Xvt (/Users/rxmvnld/.yarn/releases/yarn-4.2.2.cjs:704:5939)
at Lv (/Users/rxmvnld/.yarn/releases/yarn-4.2.2.cjs:704:7507)
at Qj (/Users/rxmvnld/.yarn/releases/yarn-4.2.2.cjs:710:384)
at _v.getCandidates (/Users/rxmvnld/.yarn/releases/yarn-4.2.2.cjs:710:3324)
at async Pd.getCandidates (/Users/rxmvnld/.yarn/releases/yarn-4.2.2.cjs:141:1271)
at async Pd.getCandidates (/Users/rxmvnld/.yarn/releases/yarn-4.2.2.cjs:141:1271)
at async /Users/rxmvnld/.yarn/releases/yarn-4.2.2.cjs:210:8401
at async Ky (/Users/rxmvnld/.yarn/releases/yarn-4.2.2.cjs:140:53910)
at async Fe (/Users/rxmvnld/.yarn/releases/yarn-4.2.2.cjs:210:8383)
β€ YN0000: β Completed in 1s 399ms
β€ YN0000: Β· Failed with errors in 1s 409ms
Im running
$ yarn patch react-native-vision-camera
Then open the temporary folder and making the changes
package com.mrousavy.camera.frameprocessors
import android.util.Log
import androidx.annotation.Keep
import androidx.annotation.UiThread
import com.facebook.jni.HybridData
import com.facebook.proguard.annotations.DoNotStrip
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.UiThreadUtil
+ import com.facebook.react.common.annotations.FrameworkAPI
import com.facebook.react.turbomodule.core.CallInvokerHolderImpl
import com.facebook.react.uimanager.UIManagerHelper
import com.mrousavy.camera.core.ViewNotFoundError
import com.mrousavy.camera.react.CameraView
import java.lang.ref.WeakReference
+ @OptIn(FrameworkAPI::class)
@Suppress("KotlinJniMissingFunction") // we use fbjni.
and finally
$ yarn patch-commit -s /private/var/folders/...
from react-native-vision-camera.
Related Issues (20)
- π [V4][Android] Release crash: maxImages (6) has already been acquired HOT 1
- π§ Not able to build expo dev client when using any of the given frame processing plugin for OCR HOT 2
- π [Android] isActive change doesn't happen fast enough causing device/camera-already-in-use error when switching to native camera app HOT 1
- π§ Execution failed for task ':react-native-vision-camera:compileReleaseKotlin'. HOT 3
- π§ This API is provided only for React Native frameworks and not intended for general users. This API can change between minor versions in alignment with React Native frameworks and won't be considered a breaking change. HOT 10
- π Android: Frameprocessor HOT 7
- π Focus not work HOT 1
- π Memory leak Android HOT 6
- π [iOS] Did someone manage to get to reasonable FPS with ML Kit Pose Detection (native frame processor plugin)? HOT 2
- π Lifecycle methods for native frame processors HOT 5
- π How to access GPS location tags in photo metadata? HOT 4
- π takePhoto() function working very slowly on Android HOT 3
- π§ A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction HOT 12
- π How does RNVC interact with OS camera settings? HOT 1
- π Is there a migration guide from V3 to V4? HOT 2
- π§ :react-native-vision-camera:compileDebugKotlin FAILED HOT 2
- Torch does not work on CodeScannerπ HOT 3
- π Hello, Which version of react-native-vision-camera supports RN 0.67? HOT 1
- Build failed with face-detector pluginπ§ HOT 3
- π Torch does not work on CodeScanner HOT 2
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 react-native-vision-camera.