Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support react-native-vision-camera v3 #32

Open
wants to merge 58 commits into
base: main
Choose a base branch
from

Conversation

ismaelsousa
Copy link

@ismaelsousa ismaelsousa commented Oct 7, 2023

Please, see the release page: releases

Download it via npm:

npm i @ismaelmoreiraa/vision-camera-ocr

Vision camera v4

for the vision camera v4 use this library from 3.0.0 and above

@ismaelsousa ismaelsousa changed the title feat: update ios side to v3 of camera vision feat: update camera vision to v3 Oct 10, 2023
@ismaelsousa ismaelsousa marked this pull request as ready for review October 11, 2023 12:46
@nikaaboda
Copy link

nikaaboda commented Oct 11, 2023

Just tested this on ios with v3 of vision camera and it's working good! I've been struggling to implement ml-kit text recognition frame processor for v3 for past 2 days and had no luck. Appreciate your work @ismaelsousa

@ismaelsousa ismaelsousa changed the title feat: update camera vision to v3 feat: support react-native-vision-camera v3 Oct 11, 2023
@crly
Copy link

crly commented Oct 13, 2023

Hello, How to update to this version?

@MariuzM MariuzM mentioned this pull request Oct 14, 2023
@DeluxeOwl
Copy link

DeluxeOwl commented Oct 15, 2023

@ismaelsousa sorry for the dumb question, but how do I use your changes in my project? Could you maybe publish a package with your updates?

@ismaelsousa
Copy link
Author

ismaelsousa commented Oct 15, 2023

@crly @DeluxeOwl you can directly install the branch on your deps. like this:
yarn add ismaelsousa/vision-camera-ocr#v2

@ismaelsousa
Copy link
Author

@ismaelsousa sorry for the dumb question, but how do I use your changes in my project? Could you maybe publish a package with your updates?

I'd like to the owner publish a new version. I contacted him, let's see :)

@crly
Copy link

crly commented Oct 16, 2023

@crly @DeluxeOwl you can directly install the branch on your deps. like this: yarn add ismaelsousa/vision-camera-ocr#v2

Can not install

@suwu150
Copy link

suwu150 commented Oct 16, 2023

@ismaelsousa I'm running on Android。

Frame Processor threw an error: Exception in HostFunction: java.lang.IllegalArgumentException: Only JPEG and YUV_420_888 are supported now

image

Does it only support Only JPEG and YUV_420_888 formats?

@suwu150
Copy link

suwu150 commented Oct 16, 2023

@crly @DeluxeOwl you can directly install the branch on your deps. like this: yarn add ismaelsousa/vision-camera-ocr#v2

Can not install

"vision-camera-ocr": "https://github.com/ismaelsousa/vision-camera-ocr/tree/94dc64b211b38976b654651c602554741c514a24"

@DeluxeOwl
Copy link

@suwu150 Currently yes, you need to add:

<Camera
        pixelFormat="yuv"
...

@crly
Copy link

crly commented Oct 16, 2023

@crly @DeluxeOwl you can directly install the branch on your deps. like this: yarn add ismaelsousa/vision-camera-ocr#v2

Can not install

"vision-camera-ocr": "https://github.com/ismaelsousa/vision-camera-ocr/tree/94dc64b211b38976b654651c602554741c514a24"

error https://github.com/ismaelsousa/vision-camera-ocr/tree/94dc64b211b38976b654651c602554741c514a24: Extracting tar content of undefined failed, the file appears to be corrupt: "Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?"

@suwu150
Copy link

suwu150 commented Oct 16, 2023

@crly @DeluxeOwl you can directly install the branch on your deps. like this: yarn add ismaelsousa/vision-camera-ocr#v2

Can not install

"vision-camera-ocr": "https://github.com/ismaelsousa/vision-camera-ocr/tree/94dc64b211b38976b654651c602554741c514a24"

error https://github.com/ismaelsousa/vision-camera-ocr/tree/94dc64b211b38976b654651c602554741c514a24: Extracting tar content of undefined failed, the file appears to be corrupt: "Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?"

What is your node version? Mine is 16.14.0. Try this version.
or The crudest way is to copy the source code to your own project

@mrousavy
Copy link

Awesome stuff ismael!

@tomerh2001
Copy link

@PereiraMatheuSilva also receiving the same error + same versions

    "react-native-worklets-core": "^0.3.0",
    "react-native-vision-camera": "^3.9.0",
    "@ismaelmoreiraa/vision-camera-ocr": "^2.2.4",

@danieloprado
Copy link

Possible fix patch:

diff --git a/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.m b/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.m
index d922d2a..22dc677 100644
--- a/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.m
+++ b/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.m
@@ -4,16 +4,4 @@
 
 #import "VisionCameraOcr-Swift.h"
 
-@interface OCRFrameProcessorPlugin (FrameProcessorPluginLoader)
-@end
-
-@implementation OCRFrameProcessorPlugin (FrameProcessorPluginLoader)
-
-+ (void)load
-{
-    [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"scanOCR" withInitializer:^FrameProcessorPlugin * _Nonnull(NSDictionary * _Nullable options) {
-        return [[OCRFrameProcessorPlugin alloc] initWithOptions:options];
-    }];
-}
-
-@end
+VISION_EXPORT_SWIFT_FRAME_PROCESSOR(OCRFrameProcessorPlugin, scanOCR)

@tomerh2001
Copy link

Possible fix patch:

diff --git a/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.m b/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.m
index d922d2a..22dc677 100644
--- a/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.m
+++ b/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.m
@@ -4,16 +4,4 @@
 
 #import "VisionCameraOcr-Swift.h"
 
-@interface OCRFrameProcessorPlugin (FrameProcessorPluginLoader)
-@end
-
-@implementation OCRFrameProcessorPlugin (FrameProcessorPluginLoader)
-
-+ (void)load
-{
-    [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"scanOCR" withInitializer:^FrameProcessorPlugin * _Nonnull(NSDictionary * _Nullable options) {
-        return [[OCRFrameProcessorPlugin alloc] initWithOptions:options];
-    }];
-}
-
-@end
+VISION_EXPORT_SWIFT_FRAME_PROCESSOR(OCRFrameProcessorPlugin, scanOCR)

Doesn't work. Also, isn't that for IOS? I (we?) get the error while building for android

@tomerh2001
Copy link

That's my error:

* What went wrong:
Execution failed for task ':ismaelmoreiraa_vision-camera-ocr:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 3m 26s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installEnvStageDebug -PreactNativeDevServerPort=8081 -PreactNativeDebugArchitectures=arm64-v8a -PreactNativeArchitectures=arm64-v8a
No modules to process in combine-js-to-schema-cli. If this is unexpected, please check if you set up your NativeComponent correctly. See combine-js-to-schema.js for how codegen finds modules.
No modules to process in combine-js-to-schema-cli. If this is unexpected, please check if you set up your NativeComponent correctly. See combine-js-to-schema.js for how codegen finds modules.
No modules to process in combine-js-to-schema-cli. If this is unexpected, please check if you set up your NativeComponent correctly. See combine-js-to-schema.js for how codegen finds modules.
(node:20632) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:2988:18: warning: the variable "DebuggerInternal" was not declared in function "__shouldPauseOnThrow" typeof DebuggerInternal !== 'undefined' && ^~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:6646:7: warning: the variable "setTimeout" was not declared in function "logCapturedError" setTimeout(function () { ^~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:4615:108: warning: the variable "nativeFabricUIManager" was not declared in function "onChange" ...lInstanceHandle ? (from && nativeFabricUIManager.setIsJSResponder(from.sta... ^~~~~~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:5227:21: warning: the variable "clearTimeout" was not declared in anonymous function " 151#" cancelTimeout = clearTimeout; ^~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:8977:30: warning: the variable "__REACT_DEVTOOLS_GLOBAL_HOOK__" was not declared in anonymous function " 151#" if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:11346:5: warning: the variable "setImmediate" was not declared in function "handleResolved" setImmediate(function () { ^~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15630:12: warning: the variable "fetch" was not declared in anonymous function " 388#" fetch: fetch, ^~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15631:14: warning: the variable "Headers" was not declared in anonymous function " 388#" Headers: Headers, ^~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15632:14: warning: the variable "Request" was not declared in anonymous function " 388#" Request: Request, ^~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15633:15: warning: the variable "Response" was not declared in anonymous function " 388#" Response: Response ^~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15790:24: warning: the variable "FileReader" was not declared in function "readBlobAsArrayBuffer" var reader = new FileReader(); ^~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15841:36: warning: the variable "Blob" was not declared in anonymous function " 399#" } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { ^~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15843:40: warning: the variable "FormData" was not declared in anonymous function " 399#" } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { ^~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15845:44: warning: the variable "URLSearchParams" was not declared in anonymous function " 399#" ...e if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body... ^~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15964:26: warning: the variable "AbortController" was not declared in anonymous function " 405#" var ctrl = new AbortController(); ^~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:16098:23: warning: the variable "XMLHttpRequest" was not declared in anonymous function " 409#" var xhr = new XMLHttpRequest(); ^~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:15643:71: warning: the variable "self" was not declared in anonymous function " 391#" ...undefined' && globalThis || typeof self !== 'undefined' && self || ^~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:25878:27: warning: the variable "performance" was not declared in anonymous function " 676#" if ("object" === typeof performance && "function" === typeof performance.no... ^~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:25901:26: warning: the variable "navigator" was not declared in anonymous function " 676#" "undefined" !== typeof navigator && undefined !== navigator.scheduling && u... ^~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:26011:37: warning: the variable "MessageChannel" was not declared in anonymous function " 676#" };else if ("undefined" !== typeof MessageChannel) { ^~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:26026:34: warning: the variable "nativeRuntimeScheduler" was not declared in anonymous function " 676#" ... = "undefined" !== typeof nativeRuntimeScheduler ? nativeRuntimeScheduler.... ^~~~~~~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:35292:34: warning: the variable "requestAnimationFrame" was not declared in function "start 9#" ... this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); ^~~~~~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:60715:76: warning: the variable "Buffer" was not declared in function "convertValue" ... 'function' ? new Blob([value]) : Buffer.from(value); ^~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:61952:56: warning: the variable "btoa" was not declared in function "dispatchXhrRequest" ...rs.set('Authorization', 'Basic ' + btoa(username + ':' + password)); ^~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:63667:31: warning: the variable "atob" was not declared in function "b64DecodeUnicode" return decodeURIComponent(atob(str).replace(/(.)/g, function (m, p) { ^~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:63845:16: warning: the variable "bootstrap" was not declared in anonymous function " 1680#" if (typeof bootstrap === "function") { ^~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:63857:23: warning: the variable "ses" was not declared in anonymous function " 1680#" } else if (typeof ses !== "undefined") { ^~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:65012:22: warning: the variable "StopIteration" was not declared in function "continuer" if (typeof StopIteration === "undefined") { ^~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:64140:16: warning: the variable "ReturnValue" was not declared in anonymous function " 1682#" if (typeof ReturnValue !== "undefined") { ^~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:124324:31: warning: the variable "normalizeDigits" was not declared in function "checkNumberGroupingIsValid" var normalizedCandidate = normalizeDigits(candidate, true ^~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:124331:28: warning: the variable "MetadataManager" was not declared in function "checkNumberGroupingIsValid" var alternateFormats = MetadataManager.getAlternateFormatsForCountry(numb... ^~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:124332:37: warning: the variable "util" was not declared in function "checkNumberGroupingIsValid" var nationalSignificantNumber = util.getNationalSignificantNumber(number); ^~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:124366:25: warning: the variable "formatNumber" was not declared in function "getNationalNumberGroups" var rfc3966Format = formatNumber(number, 'RFC3966', metadata); // We remo... ^~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:124379:53: warning: the variable "NON_DIGITS_PATTERN" was not declared in function "allNumberGroupsAreExactlyPresent" ...= normalizedCandidate.split(NON_DIGITS_PATTERN); // Set this to the last g... ^~~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:124405:43: warning: the variable "CountryCodeSource" was not declared in function "allNumberGroupsRemainGrouped" ...r.getCountryCodeSource() !== CountryCodeSource.FROM_DEFAULT_COUNTRY) { ^~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:124427:65: warning: the variable "Character" was not declared in function "allNumberGroupsRemainGrouped" ...rRegion(region, true) != null && Character.isDigit(normalizedCandidate.cha... ^~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:129793:51: warning: the variable "FileList" was not declared in function "c" ... instanceof Blob || e instanceof FileList) || !r && !i(e)) return e; ^~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:130148:77: warning: the variable "HTMLElement" was not declared in function "X" ...w ? t.defaultView.HTMLElement : HTMLElement); ^~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:176872:32: warning: the variable "crypto" was not declared in function "rng" getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValu... ^~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:181374:42: warning: the variable "Element" was not declared in function "equal" ...f (hasElementType && a instanceof Element && b instanceof Element) return ... ^~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:197097:37: warning: the variable "SC_DISABLE_SPEEDY" was not declared in anonymous function " 5772#" ... Boolean("boolean" == typeof SC_DISABLE_SPEEDY ? SC_DISABLE_SPEEDY : "unde... ^~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:197167:37: warning: the variable "__webpack_nonce__" was not declared in function "B 5#" ...ar i = "undefined" != typeof __webpack_nonce__ ? __webpack_nonce__ : null; ^~~~~~~~~~~~~~~~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:202044:25: warning: the variable "URL" was not declared in function "origin" fromUrl = new URL(from.source, this.map.consumer().sourceRoot || _$... ^~~ android\app\build\generated\assets\createBundleEnvStageDebugJsAndAssets\index.android.bundle:216146:20: warning: the variable "WeakRef" was not declared in anonymous function " 6504#" var Ref = typeof WeakRef !== "undefined" ? WeakRef : StrongRef; ^~~~~~~ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\projects\x-workspace\projects\x\node_modules\@react-native-clipboard\clipboard\android\src\main\java\com\reactnativecommunity\clipboard\ClipboardPackage.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\projects\x-workspace\projects\x\node_modules\react-native-date-picker\android\src\main\java\com\henninghall\date_picker\DerivedData.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\projects\x-workspace\projects\x\node_modules\react-native-fast-tflite\android\src\main\java\com\tflite\TfliteModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\projects\x-workspace\projects\x\node_modules\react-native-flipper\android\src\debug\java\com\facebook\flipper\reactnative\FlipperModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\projects\x-workspace\projects\x\node_modules\react-native-orientation-locker\android\src\main\java\org\wonday\orientation\OrientationModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. C:\projects\x-workspace\projects\x\node_modules\@react-native-picker\picker\android\src\fabric\java\com\reactnativecommunity\picker\FabricEnabledPicker.java:19: warning: [removal] FabricViewStateManager in com.facebook.react.uimanager has been deprecated and marked for removal public abstract class FabricEnabledPicker extends AppCompatSpinner implements FabricViewStateManager.HasFabricViewStateManager { ^ C:\projects\x-workspace\projects\x\node_modules\@react-native-picker\picker\android\src\fabric\java\com\reactnativecommunity\picker\FabricEnabledPicker.java:20: warning: [removal] FabricViewStateManager in com.facebook.react.uimanager has been deprecated and marked for removal private FabricViewStateManager mFabricViewStateManager d\src\main\java\com\toyberman\Utils\OkHttpUtils.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. C:\projects\x-workspace\projects\x\node_modules\react-native-svg\android\src\main\java\com\horcrux\svg\RNSVGRenderableManager.java:11: warning: [removal] StandardCharsets in com.facebook.react.common has been deprecated and marked for removal import static com.facebook.react.common.StandardCharsets.UTF_8; ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 warning Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. e: file:///C:/projects/x-workspace/projects/x/node_modules/@ismaelmoreiraa/vision-camera-ocr/android/src/main/java/com/visioncameraocr/OCRFrameProcessorPlugin.kt:20:90 Too many arguments for public constructor FrameProcessorPlugin() defined in com.mrousavy.camera.frameprocessor.FrameProcessorPlugin e: file:///C:/projects/x-workspace/projects/x/node_modules/@ismaelmoreiraa/vision-camera-ocr/android/src/main/java/com/visioncameraocr/VisionCameraOcrPackage.kt:15:77 Expected 2 parameters of types VisionCameraProxy, (Mutable)Map<String!, Any!>? e: file:///C:/projects/x-workspace/projects/x/node_modules/@ismaelmoreiraa/vision-camera-ocr/android/src/main/java/com/visioncameraocr/VisionCameraOcrPackage.kt:15:77 Type mismatch: inferred type is () -> FrameProcessorPlugin but ((VisionCameraProxy, (Mutable)Map<String!, Any!>?) -> FrameProcessorPlugin)! was expected e: file:///C:/projects/x-workspace/projects/x/node_modules/@ismaelmoreiraa/vision-camera-ocr/android/src/main/java/com/visioncameraocr/VisionCameraOcrPackage.kt:16:42 Unresolved reference: it Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ismaelmoreiraa_vision-camera-ocr:compileDebugKotlin'. > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction > Compilation error. See log for more details * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 3m 26s.
info Run CLI with --verbose flag for more details.

@danieloprado
Copy link

ismaelsousa#6 Updated

diff --git a/node_modules/@ismaelmoreiraa/vision-camera-ocr/android/src/main/java/com/visioncameraocr/OCRFrameProcessorPlugin.kt b/node_modules/@ismaelmoreiraa/vision-camera-ocr/android/src/main/java/com/visioncameraocr/OCRFrameProcessorPlugin.kt
index d87251b..a5bda18 100644
--- a/node_modules/@ismaelmoreiraa/vision-camera-ocr/android/src/main/java/com/visioncameraocr/OCRFrameProcessorPlugin.kt
+++ b/node_modules/@ismaelmoreiraa/vision-camera-ocr/android/src/main/java/com/visioncameraocr/OCRFrameProcessorPlugin.kt
@@ -17,7 +17,7 @@
  import com.mrousavy.camera.frameprocessor.FrameProcessorPlugin
  import com.mrousavy.camera.types.Orientation
 
- class OCRFrameProcessorPlugin(options: MutableMap<String, Any>?) : FrameProcessorPlugin(options) {
+ class OCRFrameProcessorPlugin(options: MutableMap<String, Any>?) : FrameProcessorPlugin() {
 
      private fun getBlockArray(blocks: MutableList<Text.TextBlock>): List<HashMap<String, Any?>> {
          val blockArray = mutableListOf<HashMap<String, Any?>>()
diff --git a/node_modules/@ismaelmoreiraa/vision-camera-ocr/android/src/main/java/com/visioncameraocr/VisionCameraOcrPackage.kt b/node_modules/@ismaelmoreiraa/vision-camera-ocr/android/src/main/java/com/visioncameraocr/VisionCameraOcrPackage.kt
index 00cc15e..c6c7a54 100644
--- a/node_modules/@ismaelmoreiraa/vision-camera-ocr/android/src/main/java/com/visioncameraocr/VisionCameraOcrPackage.kt
+++ b/node_modules/@ismaelmoreiraa/vision-camera-ocr/android/src/main/java/com/visioncameraocr/VisionCameraOcrPackage.kt
@@ -12,8 +12,8 @@
      override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
          if(!OCRFrameProcessorPlugin.isRegistered){
              OCRFrameProcessorPlugin.isRegistered = true
-             FrameProcessorPluginRegistry.addFrameProcessorPlugin("scanOCR"){
-                 OCRFrameProcessorPlugin(it)
+             FrameProcessorPluginRegistry.addFrameProcessorPlugin("scanOCR"){ _ , options ->
+                 OCRFrameProcessorPlugin(options)
              }
          }
          return emptyList()
diff --git a/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.m b/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.m
index d922d2a..22dc677 100644
--- a/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.m
+++ b/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.m
@@ -4,16 +4,4 @@
 
 #import "VisionCameraOcr-Swift.h"
 
-@interface OCRFrameProcessorPlugin (FrameProcessorPluginLoader)
-@end
-
-@implementation OCRFrameProcessorPlugin (FrameProcessorPluginLoader)
-
-+ (void)load
-{
-    [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"scanOCR" withInitializer:^FrameProcessorPlugin * _Nonnull(NSDictionary * _Nullable options) {
-        return [[OCRFrameProcessorPlugin alloc] initWithOptions:options];
-    }];
-}
-
-@end
+VISION_EXPORT_SWIFT_FRAME_PROCESSOR(OCRFrameProcessorPlugin, scanOCR)

@ismaelsousa
Copy link
Author

Hey guy, sorry for the confusion.
I forgot to update the example project 🤦

From now on, please always check the example project dependencies to see which versions are compatible.

@danieloprado thanks again

Please, bump all versions to the latest like this: deps

Release available for this one a minor change: 2.3.0

@PereiraMatheuSilva
Copy link

O Windows PowerShell
Copyright (C) Microsoft Corporation. Todos os direitos reservados.

Instale o PowerShell mais recente para obter novos recursos e aprimoramentos! https://aka.ms/PSWindows

PS D:\Projetos_Freela\appMuffato> yarn android
yarn run v1.22.19
$ react-native run-android
info Installing the app...

Configure project :react-native-vision-camera
[VisionCamera] react-native-worklets-core found, Frame Processors enabled!

Task :react-native-vision-camera:buildCMakeDebug[arm64-v8a] FAILED
C/C++: ninja: Entering directory `D:\Projetos_Freela\appMuffato\node_modules\react-native-vision-camera\android.cxx\Debug\364rfs4t\arm64-v8a'
C/C++: cmd.exe /C "cd . && C:\Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android21 --sysroot=C:/Users/mps/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -O2 -frtti -fexceptions -Wall -Wno-unused-variable -fstack-protector-all -g -fno-limit-debug-info -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Qunused-arguments -Wl,--no-undefined -shared -Wl,-soname,libVisionCamera.so -o ........\build\intermediates\cxx\Debug\364rfs4t\obj\arm64-v8a\libVisionCamera.so CMakeFiles/VisionCamera.dir/D_/Projetos_Freela/appMuffato/node_modules/react-native-vision-camera/cpp/MutableRawBuffer.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/VisionCamera.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/VideoPipeline.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/PassThroughShader.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/OpenGLContext.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/OpenGLRenderer.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/MutableJByteBuffer.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/FrameHostObject.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/FrameProcessorPluginHostObject.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/JSIJNIConversion.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/VisionCameraProxy.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JSharedArray.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrame.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessorPlugin.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraScheduler.cpp.o C:/Users/mps/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/21/liblog.so -landroid C:/Users/mps/.gradle/caches/transforms-3/3ce902105a4ff251177e5b9f5c724b87/transformed/jetified-react-android-0.73.5-debug/prefab/modules/jsi/libs/android.arm64-v8a/libjsi.so C:/Users/mps/.gradle/caches/transforms-3/3ce902105a4ff251177e5b9f5c724b87/transformed/jetified-react-android-0.73.5-debug/prefab/modules/reactnativejni/libs/android.arm64-v8a/libreactnativejni.so C:/Users/mps/.gradle/caches/transforms-3/057fda56c2cfc52d70a46042a30c6944/transformed/jetified-fbjni-0.5.1/prefab/modules/fbjni/libs/android.arm64-v8a/libfbjni.so -lGLESv2 -lEGL -latomic -lm && cd ."
C/C++: ld: error: undefined symbol: RNWorklet::JsiWorkletContext::getWorkletRuntime()
C/C++: >>> referenced by JVisionCameraProxy.h:42 (D:/Projetos_Freela/appMuffato/node_modules/react-native-vision-camera/android/src/main/cpp/frameprocessor/java-bindings\JVisionCameraProxy.h:42)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JSharedArray.cpp.o:(vision::JSharedArray::JSharedArray(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JSharedArray, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*> const&, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraProxy, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*> const&, facebook::jni::alias_reffacebook::jni::JByteBuffer))
C/C++: >>> referenced by JFrameProcessor.cpp:37 (D:/Projetos_Freela/appMuffato/node_modules/react-native-vision-camera/android/src/main/cpp/frameprocessor/java-bindings\JFrameProcessor.cpp:37)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(vision::JFrameProcessor::callWithFrameHostObject(std::__ndk1::shared_ptrvision::FrameHostObject const&) const)
C/C++: ld: error: undefined symbol: RNWorklet::JsiWorkletContext::runtimeMappings
C/C++: >>> referenced by __tree:0 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1__tree:0)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::call(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long))
C/C++: >>> referenced by __tree:0 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1__tree:0)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::call(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long))
C/C++: ld: error: undefined symbol: RNWorklet::JsiWorkletContext::invokeOnWorkletThread(std::__ndk1::function<void (RNWorklet::JsiWorkletContext*, facebook::jsi::Runtime&)>&&)
C/C++: >>> referenced by WKTJsiWorklet.h:372 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:372)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::~WorkletInvoker())
C/C++: ld: error: undefined symbol: RNWorklet::JsiWorkletContext::invokeOnJsThread(std::__ndk1::function<void (facebook::jsi::Runtime&)>&&)
C/C++: >>> referenced by WKTJsiWorklet.h:369 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:369)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::WorkletInvoker())
C/C++: ld: error: undefined symbol: RNWorklet::JsiWorkletContext::defaultInstance
C/C++: >>> referenced by memory:3887 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:3887)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())
C/C++: >>> referenced by memory:3887 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:3887)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())
C/C++: ld: error: undefined symbol: RNWorklet::JsiHostObject::JsiHostObject()
C/C++: >>> referenced by WKTJsiWorkletContext.h:31 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorkletContext.h:31)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())
C/C++: >>> referenced by WKTJsiWorklet.h:77 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:77)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::JsiWorklet(facebook::jsi::Runtime&, facebook::jsi::Value const&))
C/C++: ld: error: undefined symbol: vtable for RNWorklet::JsiWorkletContext
C/C++: >>> referenced by WKTJsiWorkletContext.h:31 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorkletContext.h:31)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())
C/C++: >>> referenced by WKTJsiWorkletContext.h:31 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorkletContext.h:31)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())
C/C++: >>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
C/C++: ld: error: undefined symbol: RNWorklet::JsiWorkletContext::JsiWorkletContext()
C/C++: >>> referenced by memory:2252 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:2252)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(std::__ndk1::__shared_ptr_emplace<RNWorklet::JsiWorkletContext, std::__ndk1::allocatorRNWorklet::JsiWorkletContext >::
__shared_ptr_emplace())
C/C++: >>> referenced by memory:2252 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:2252)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(std::__ndk1::__shared_ptr_emplace<RNWorklet::JsiWorkletContext, std::__ndk1::allocatorRNWorklet::JsiWorkletContext >::
__shared_ptr_emplace())
C/C++: ld: error: undefined symbol: RNWorklet::JsiWorkletContext::JsiWorkletContext(std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > const&, facebook::jsi::Runtime*, std::__ndk1::function<void (std::__ndk1::function<void ()>&&)>, std::__ndk1::function<void (std::__ndk1::function<void ()>&&)>)
C/C++: >>> referenced by memory:2278 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:2278)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vision::JVisionCameraProxy::JVisionCameraProxy(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraProxy, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*> const&, facebook::jsi::Runtime*, std::__ndk1::shared_ptrfacebook::react::CallInvoker const&, facebook::jni::basic_strong_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, facebook::jni::GlobalReferenceAllocator> const&))
C/C++: ld: error: undefined symbol: RNWorklet::JsiHostObject::~JsiHostObject()
C/C++: >>> referenced by WKTJsiWorklet.h:79 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:79)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::JsiWorklet(facebook::jsi::Runtime&, facebook::jsi::Value const&))
C/C++: >>> referenced by WKTJsiWorklet.h:74 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:74)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::~JsiWorklet())
C/C++: ld: error: undefined symbol: RNWorklet::JsiWrapper::wrap(facebook::jsi::Runtime&, facebook::jsi::Value const&, RNWorklet::JsiWrapper*)
C/C++: >>> referenced by WKTJsiWrapper.h:62 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWrapper.h:62)
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::createWorklet(facebook::jsi::Runtime&, std::__ndk1::shared_ptrfacebook::jsi::Function))
C/C++: ld: error: undefined symbol: RNWorklet::JsiHostObject::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)
C/C++: >>> referenced by JVisionCameraProxy.cpp
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet)
C/C++: ld: error: undefined symbol: RNWorklet::JsiHostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)
C/C++: >>> referenced by JVisionCameraProxy.cpp
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet)
C/C++: ld: error: undefined symbol: RNWorklet::JsiHostObject::getPropertyNames(facebook::jsi::Runtime&)
C/C++: >>> referenced by JVisionCameraProxy.cpp
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet)
C/C++: ld: error: undefined symbol: typeinfo for RNWorklet::JsiHostObject
C/C++: >>> referenced by JVisionCameraProxy.cpp
C/C++: >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(typeinfo for RNWorklet::JsiWorklet)
C/C++: clang++: error: linker command failed with exit code 1 (use -v to see invocation)
C/C++: ninja: build stopped: subcommand failed.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
93 actionable tasks: 15 executed, 78 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-vision-camera:buildCMakeDebug[arm64-v8a]'.

com.android.ide.common.process.ProcessException: ninja: Entering directory `D:\Projetos_Freela\appMuffato\node_modules\react-native-vision-camera\android.cxx\Debug\364rfs4t\arm64-v8a'
[1/1] Linking CXX shared library ........\build\intermediates\cxx\Debug\364rfs4t\obj\arm64-v8a\libVisionCamera.so
FAILED: ../../../../build/intermediates/cxx/Debug/364rfs4t/obj/arm64-v8a/libVisionCamera.so
cmd.exe /C "cd . && C:\Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android21 --sysroot=C:/Users/mps/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -O2 -frtti -fexceptions -Wall -Wno-unused-variable -fstack-protector-all -g -fno-limit-debug-info -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Qunused-arguments -Wl,--no-undefined -shared -Wl,-soname,libVisionCamera.so -o ........\build\intermediates\cxx\Debug\364rfs4t\obj\arm64-v8a\libVisionCamera.so CMakeFiles/VisionCamera.dir/D_/Projetos_Freela/appMuffato/node_modules/react-native-vision-camera/cpp/MutableRawBuffer.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/VisionCamera.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/VideoPipeline.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/PassThroughShader.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/OpenGLContext.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/OpenGLRenderer.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/MutableJByteBuffer.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/FrameHostObject.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/FrameProcessorPluginHostObject.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/JSIJNIConversion.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/VisionCameraProxy.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JSharedArray.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrame.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessorPlugin.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraScheduler.cpp.o C:/Users/mps/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/21/liblog.so -landroid C:/Users/mps/.gradle/caches/transforms-3/3ce902105a4ff251177e5b9f5c724b87/transformed/jetified-react-android-0.73.5-debug/prefab/modules/jsi/libs/android.arm64-v8a/libjsi.so C:/Users/mps/.gradle/caches/transforms-3/3ce902105a4ff251177e5b9f5c724b87/transformed/jetified-react-android-0.73.5-debug/prefab/modules/reactnativejni/libs/android.arm64-v8a/libreactnativejni.so C:/Users/mps/.gradle/caches/transforms-3/057fda56c2cfc52d70a46042a30c6944/transformed/jetified-fbjni-0.5.1/prefab/modules/fbjni/libs/android.arm64-v8a/libfbjni.so -lGLESv2 -lEGL -latomic -lm && cd ."
ld: error: undefined symbol: RNWorklet::JsiWorkletContext::getWorkletRuntime()

referenced by JVisionCameraProxy.h:42 (D:/Projetos_Freela/appMuffato/node_modules/react-native-vision-camera/android/src/main/cpp/frameprocessor/java-bindings\JVisionCameraProxy.h:42)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JSharedArray.cpp.o:(vision::JSharedArray::JSharedArray(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JSharedArray, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*> const&, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraProxy, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*> const&, facebook::jni::alias_reffacebook::jni::JByteBuffer))
referenced by JFrameProcessor.cpp:37 (D:/Projetos_Freela/appMuffato/node_modules/react-native-vision-camera/android/src/main/cpp/frameprocessor/java-bindings\JFrameProcessor.cpp:37)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(vision::JFrameProcessor::callWithFrameHostObject(std::__ndk1::shared_ptrvision::FrameHostObject const&) const)

ld: error: undefined symbol: RNWorklet::JsiWorkletContext::runtimeMappings

referenced by __tree:0 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1__tree:0)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::call(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long))
referenced by __tree:0 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1__tree:0)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::call(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long))

ld: error: undefined symbol: RNWorklet::JsiWorkletContext::invokeOnWorkletThread(std::__ndk1::function<void (RNWorklet::JsiWorkletContext*, facebook::jsi::Runtime&)>&&)

referenced by WKTJsiWorklet.h:372 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:372)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::~WorkletInvoker())

ld: error: undefined symbol: RNWorklet::JsiWorkletContext::invokeOnJsThread(std::__ndk1::function<void (facebook::jsi::Runtime&)>&&)

referenced by WKTJsiWorklet.h:369 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:369)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::~WorkletInvoker())

ld: error: undefined symbol: RNWorklet::JsiWorkletContext::defaultInstance

referenced by memory:3887 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:3887)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())
referenced by memory:3887 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:3887)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())

ld: error: undefined symbol: RNWorklet::JsiHostObject::JsiHostObject()

referenced by WKTJsiWorkletContext.h:31 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorkletContext.h:31)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())
referenced by WKTJsiWorklet.h:77 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:77)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::JsiWorklet(facebook::jsi::Runtime&, facebook::jsi::Value const&))

ld: error: undefined symbol: vtable for RNWorklet::JsiWorkletContext

referenced by WKTJsiWorkletContext.h:31 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorkletContext.h:31)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())
referenced by WKTJsiWorkletContext.h:31 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorkletContext.h:31)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance())
the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)

ld: error: undefined symbol: RNWorklet::JsiWorkletContext::~JsiWorkletContext()

referenced by memory:2252 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:2252)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(std::__ndk1::__shared_ptr_emplace<RNWorklet::JsiWorkletContext, std::__ndk1::allocatorRNWorklet::JsiWorkletContext >::__shared_ptr_emplace())
referenced by memory:2252 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:2252)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(std::__ndk1::__shared_ptr_emplace<RNWorklet::JsiWorkletContext, std::__ndk1::allocatorRNWorklet::JsiWorkletContext >::
__shared_ptr_emplace())

ld: error: undefined symbol: RNWorklet::JsiWorkletContext::JsiWorkletContext(std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > const&, facebook::jsi::Runtime*, std::__ndk1::function<void (std::__ndk1::function<void ()>&&)>, std::__ndk1::function<void (std::__ndk1::function<void ()>&&)>)

referenced by memory:2278 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:2278)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vision::JVisionCameraProxy::JVisionCameraProxy(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraProxy, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*> const&, facebook::jsi::Runtime*, std::__ndk1::shared_ptrfacebook::react::CallInvoker const&, facebook::jni::basic_strong_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, facebook::jni::GlobalReferenceAllocator> const&))

ld: error: undefined symbol: RNWorklet::JsiHostObject::~JsiHostObject()

referenced by WKTJsiWorklet.h:79 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:79)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::JsiWorklet(facebook::jsi::Runtime&, facebook::jsi::Value const&))
referenced by WKTJsiWorklet.h:74 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:74)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::~JsiWorklet())

ld: error: undefined symbol: RNWorklet::JsiWrapper::wrap(facebook::jsi::Runtime&, facebook::jsi::Value const&, RNWorklet::JsiWrapper*)

referenced by WKTJsiWrapper.h:62 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWrapper.h:62)
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::createWorklet(facebook::jsi::Runtime&, std::__ndk1::shared_ptrfacebook::jsi::Function))

ld: error: undefined symbol: RNWorklet::JsiHostObject::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)

referenced by JVisionCameraProxy.cpp
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet)

ld: error: undefined symbol: RNWorklet::JsiHostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)

referenced by JVisionCameraProxy.cpp
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet)

ld: error: undefined symbol: RNWorklet::JsiHostObject::getPropertyNames(facebook::jsi::Runtime&)

referenced by JVisionCameraProxy.cpp
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet)

ld: error: undefined symbol: typeinfo for RNWorklet::JsiHostObject

referenced by JVisionCameraProxy.cpp
CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(typeinfo for RNWorklet::JsiWorklet)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

C++ build system [build] failed while executing:
@echo off
"C:\Users\mps\AppData\Local\Android\Sdk\cmake\3.22.1\bin\ninja.exe" ^
-C ^
"D:\Projetos_Freela\appMuffato\node_modules\react-native-vision-camera\android\.cxx\Debug\364rfs4t\arm64-v8a" ^
VisionCamera
from D:\Projetos_Freela\appMuffato\node_modules\react-native-vision-camera\android

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

BUILD FAILED in 25s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-vision-camera:buildCMakeDebug[arm64-v8a]'. > com.android.ide.common.process.ProcessException: ninja: Entering directory `D:\Projetos_Freela\appMuffato\node_modules\react-native-vision-camera\android.cxx\Debug\364rfs4t\arm64-v8a' [1/1] Linking CXX shared library ........\build\intermediates\cxx\Debug\364rfs4t\obj\arm64-v8a\libVisionCamera.so FAILED: ../../../../build/intermediates/cxx/Debug/364rfs4t/obj/arm64-v8a/libVisionCamera.so cmd.exe /C "cd . && C:\Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android21 --sysroot=C:/Users/mps/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -O2 -frtti -fexceptions -Wall -Wno-unused-variable -fstack-protector-all -g -fno-limit-debug-info -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Qunused-arguments -Wl,--no-undefined -shared -Wl,-soname,libVisionCamera.so -o ........\build\intermediates\cxx\Debug\364rfs4t\obj\arm64-v8a\libVisionCamera.so CMakeFiles/VisionCamera.dir/D_/Projetos_Freela/appMuffato/node_modules/react-native-vision-camera/cpp/MutableRawBuffer.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/VisionCamera.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/VideoPipeline.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/PassThroughShader.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/OpenGLContext.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/OpenGLRenderer.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/MutableJByteBuffer.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/FrameHostObject.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/FrameProcessorPluginHostObject.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/JSIJNIConversion.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/VisionCameraProxy.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JSharedArray.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrame.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessorPlugin.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraScheduler.cpp.o C:/Users/mps/AppData/Local/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/21/liblog.so -landroid C:/Users/mps/.gradle/caches/transforms-3/3ce902105a4ff251177e5b9f5c724b87/transformed/jetified-react-android-0.73.5-debug/prefab/modules/jsi/libs/android.arm64-v8a/libjsi.so C:/Users/mps/.gradle/caches/transforms-3/3ce902105a4ff251177e5b9f5c724b87/transformed/jetified-react-android-0.73.5-debug/prefab/modules/reactnativejni/libs/android.arm64-v8a/libreactnativejni.so C:/Users/mps/.gradle/caches/transforms-3/057fda56c2cfc52d70a46042a30c6944/transformed/jetified-fbjni-0.5.1/prefab/modules/fbjni/libs/android.arm64-v8a/libfbjni.so -lGLESv2 -lEGL -latomic -lm && cd ." ld: error: undefined symbol: RNWorklet::JsiWorkletContext::getWorkletRuntime() >>> referenced by JVisionCameraProxy.h:42 (D:/Projetos_Freela/appMuffato/node_modules/react-native-vision-camera/android/src/main/cpp/frameprocessor/java-bindings\JVisionCameraProxy.h:42) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JSharedArray.cpp.o:(vision::JSharedArray::JSharedArray(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JSharedArray, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*> const&, facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraProxy, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*> const&, facebook::jni::alias_reffacebook::jni::JByteBuffer)) >>> referenced by JFrameProcessor.cpp:37 (D:/Projetos_Freela/appMuffato/node_modules/react-native-vision-camera/android/src/main/cpp/frameprocessor/java-bindings\JFrameProcessor.cpp:37) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(vision::JFrameProcessor::callWithFrameHostObject(std::__ndk1::shared_ptrvision::FrameHostObject const&) const) ld: error: undefined symbol: RNWorklet::JsiWorkletContext::runtimeMappings >>> referenced by __tree:0 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1__tree:0) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::call(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)) >>> referenced by __tree:0 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1__tree:0) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::call(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)) ld: error: undefined symbol: RNWorklet::JsiWorkletContext::invokeOnWorkletThread(std::__ndk1::function<void (RNWorklet::JsiWorkletContext*, facebook::jsi::Runtime&)>&&) >>> referenced by WKTJsiWorklet.h:372 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:372) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::~WorkletInvoker()) ld: error: undefined symbol: RNWorklet::JsiWorkletContext::invokeOnJsThread(std::__ndk1::function<void (facebook::jsi::Runtime&)>&&) >>> referenced by WKTJsiWorklet.h:369 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:369) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::WorkletInvoker::WorkletInvoker()) ld: error: undefined symbol: RNWorklet::JsiWorkletContext::defaultInstance >>> referenced by memory:3887 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:3887) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance()) >>> referenced by memory:3887 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:3887) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance()) ld: error: undefined symbol: RNWorklet::JsiHostObject::JsiHostObject() >>> referenced by WKTJsiWorkletContext.h:31 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorkletContext.h:31) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance()) >>> referenced by WKTJsiWorklet.h:77 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:77) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::JsiWorklet(facebook::jsi::Runtime&, facebook::jsi::Value const&)) ld: error: undefined symbol: vtable for RNWorklet::JsiWorkletContext >>> referenced by WKTJsiWorkletContext.h:31 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorkletContext.h:31) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance()) >>> referenced by WKTJsiWorkletContext.h:31 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorkletContext.h:31) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(RNWorklet::JsiWorkletContext::getDefaultInstance()) >>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction) ld: error: undefined symbol: RNWorklet::JsiWorkletContext::JsiWorkletContext() >>> referenced by memory:2252 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:2252) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(std::__ndk1::__shared_ptr_emplace<RNWorklet::JsiWorkletContext, std::__ndk1::allocatorRNWorklet::JsiWorkletContext >::__shared_ptr_emplace()) >>> referenced by memory:2252 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:2252) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JFrameProcessor.cpp.o:(std::__ndk1::__shared_ptr_emplace<RNWorklet::JsiWorkletContext, std::__ndk1::allocatorRNWorklet::JsiWorkletContext >::__shared_ptr_emplace()) ld: error: undefined symbol: RNWorklet::JsiWorkletContext::JsiWorkletContext(std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > const&, facebook::jsi::Runtime*, std::__ndk1::function<void (std::__ndk1::function<void ()>&&)>, std::__ndk1::function<void (std::__ndk1::function<void ()>&&)>) >>> referenced by memory:2278 (C:/Users\mps\AppData\Local\Android\Sdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\c++\v1\memory:2278) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vision::JVisionCameraProxy::JVisionCameraProxy(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraProxy, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*> const&, facebook::jsi::Runtime*, std::__ndk1::shared_ptrfacebook::react::CallInvoker const&, facebook::jni::basic_strong_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<vision::JVisionCameraScheduler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, facebook::jni::GlobalReferenceAllocator> const&)) ld: error: undefined symbol: RNWorklet::JsiHostObject::~JsiHostObject() >>> referenced by WKTJsiWorklet.h:79 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:79) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::JsiWorklet(facebook::jsi::Runtime&, facebook::jsi::Value const&)) >>> referenced by WKTJsiWorklet.h:74 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWorklet.h:74) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::~JsiWorklet()) ld: error: undefined symbol: RNWorklet::JsiWrapper::wrap(facebook::jsi::Runtime&, facebook::jsi::Value const&, RNWorklet::JsiWrapper*) >>> referenced by WKTJsiWrapper.h:62 (D:/Projetos_Freela/appMuffato/node_modules/react-native-worklets-core/android/build/headers/rnworklets\react-native-worklets-core\WKTJsiWrapper.h:62) >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(RNWorklet::JsiWorklet::createWorklet(facebook::jsi::Runtime&, std::__ndk1::shared_ptrfacebook::jsi::Function)) ld: error: undefined symbol: RNWorklet::JsiHostObject::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&) >>> referenced by JVisionCameraProxy.cpp >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet) ld: error: undefined symbol: RNWorklet::JsiHostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&) >>> referenced by JVisionCameraProxy.cpp >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet) ld: error: undefined symbol: RNWorklet::JsiHostObject::getPropertyNames(facebook::jsi::Runtime&) >>> referenced by JVisionCameraProxy.cpp >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(vtable for RNWorklet::JsiWorklet) ld: error: undefined symbol: typeinfo for RNWorklet::JsiHostObject >>> referenced by JVisionCameraProxy.cpp >>> CMakeFiles/VisionCamera.dir/src/main/cpp/frameprocessor/java-bindings/JVisionCameraProxy.cpp.o:(typeinfo for RNWorklet::JsiWorklet) clang++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. C++ build system [build] failed while executing: @echo off "C:\Users\mps\AppData\Local\Android\Sdk\cmake\3.22.1\bin\ninja.exe" ^ -C ^ "D:\Projetos_Freela\appMuffato\node_modules\react-native-vision-camera\android\.cxx\Debug\364rfs4t\arm64-v8a" ^ VisionCamera from D:\Projetos_Freela\appMuffato\node_modules\react-native-vision-camera\android * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 25s.
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PS D:\Projetos_Freela\appMuffato>

Boa tarde, não estou conseguindo rodar o plugin, está gerando o erro acima meu package.json está assim:

{
"name": "appMuffato",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@ismaelmoreiraa/vision-camera-ocr": "^2.3.1",
"react": "18.2.0",
"react-native": "0.73.5",
"react-native-vision-camera": "^3.9.0",
"react-native-worklets-core": "^0.3.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.73.21",
"@react-native/eslint-config": "0.73.2",
"@react-native/metro-config": "0.73.5",
"@react-native/typescript-config": "0.73.1",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.2.0",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
}

Será que é algum problema na minha configuração?

@ismaelsousa
Copy link
Author

@PereiraMatheuSilva olá, parece que o vision camera não está conseguindo compilar.
Tentar apagar a pasta .gradle e a build dentro de android/app e roda de novo

@PereiraMatheuSilva
Copy link

Hey everyone, I managed to solve the issue I was facing here. I resolved it by installing all the dependencies first and only then performing the build. It worked for me here.

@tomerh2001
Copy link

tomerh2001 commented Mar 25, 2024

Has someone found a solution for the orientation in IOS?

Edit: I created a patch that works for me; I'll try to open a PR for @ismaelsousa 's version.
This is the patch file:

diff --git a/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.swift b/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.swift
index 5c8bd5e..598a95f 100644
--- a/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.swift
+++ b/node_modules/@ismaelmoreiraa/vision-camera-ocr/ios/VisionCameraOcr.swift
@@ -120,6 +120,21 @@ public class OCRFrameProcessorPlugin: FrameProcessorPlugin {
          ]}
     }
 
+    private static func convertOrientation(_ orientation: UIImageOrientation) -> UIImageOrientation {
+        switch orientation {
+        case .left:
+            return .right
+        case .right:
+            return .left
+        case .leftMirrored:
+            return .rightMirrored
+        case .rightMirrored:
+            return .leftMirrored
+        default:
+            return orientation
+        }
+    }
+
     public override func callback(_ frame: Frame, withArguments arguments: [AnyHashable: Any]?) -> Any? {
         
         guard let imageBuffer = CMSampleBufferGetImageBuffer(frame.buffer) else {
@@ -135,11 +150,8 @@ public class OCRFrameProcessorPlugin: FrameProcessorPlugin {
         }
         
         let image = UIImage(cgImage: cgImage)
-       
         let visionImage = VisionImage(image: image)
-        
-        // TODO: Get camera orientation state
-        visionImage.orientation = .up
+        visionImage.orientation = convertOrientation(frame.orientation)
 
         var result: Text

@shantanukorgaonkar
Copy link

shantanukorgaonkar commented Mar 26, 2024

Hey everyone, I managed to solve the issue I was facing here. I resolved it by installing all the dependencies first and only then performing the build. It worked for me here.

I faced a similar issue. Fixed it by deletingandroid/.gradle, android/app/build and node_modules. Then npm i and npm run android

   { "@ismaelmoreiraa/vision-camera-ocr": "^2.3.1",
        "react-native-vision-camera": "^3.9.0",
    "react-native-worklets-core": "^0.4.0"}

@ismaelsousa Thanks for continuously maintaining this plugin. @aarongrider Do merge in the main library

@mayran-logmanager
Copy link

@ismaelsousa the camera is too slow, it's like low fps. I noticed that when I comment the const data = scanOCR(frame); it works fine. can anyone help ?
"dependencies": {
"@ismaelmoreiraa/vision-camera-ocr": "^2.3.1",
"expo": "~50.0.14",
"expo-status-bar": "~1.11.1",
"react": "18.2.0",
"react-native": "0.73.6",
"react-native-vision-camera": "^3.9.2",
"react-native-worklets-core": "^0.3.0",
"typescript": "^5.3.0"
},

@ismaelsousa
Copy link
Author

@mayran-logmanager are you adjusting the camera fps based on the fps suggested?

@mayran-logmanager
Copy link

@ismaelsousa I'm using the same code from example in the project. But I just fixed it by setting enableGpuBuffers={true}. now its fluid again

@pedrol2b
Copy link

pedrol2b commented Apr 18, 2024

@ismaelsousa I'm using the same code from example in the project. But I just fixed it by setting enableGpuBuffers={true}. now its fluid again

Beware that

* experimental This is an experimental feature flag, use at your own risk. Some devices (especially Samsungs) may crash when trying to use GPU buffers.
* platform Android (API 29+)

Thats in the JDOCS, and its confirmed that this param cause crash in samsumg.

Full JDOCS for enableGpuBuffers

  /**
   * Enables or disables GPU-sampled buffers for the video stream. This only takes effect when using a {@linkcode frameProcessor}.
   *
   * When recording a Video ({@linkcode video}) while a Frame Processor is running ({@linkcode frameProcessor}),
   * the {@linkcode Frame | Frames} will need to be forwarded to the Media Encoder.
   *
   * - When `enableGpuBuffers` is `false`, the Video Pipeline will use CPU buffers causing an additional copy
   * from the Frame Processor to the Media Encoder, which potentially results in increased latency.
   * - When `enableGpuBuffers` is `true`, the Video Pipeline will use shared GPU buffers which greatly increases
   * it's efficiency as an additional buffer copy is avoided.
   * (See [`USAGE_GPU_SAMPLED_IMAGE`](https://developer.android.com/reference/android/hardware/HardwareBuffer#USAGE_GPU_SAMPLED_IMAGE))
   *
   * In general, it is recommended to set this to `true` if possible, as this can increase performance and efficiency of the Video Pipeline.
   *
   * @experimental This is an experimental feature flag, use at your own risk. Some devices (especially Samsungs) may crash when trying to use GPU buffers.
   * @platform Android (API 29+)
   * @default false
   */
  enableGpuBuffers?: boolean

instead of using this..
i'd suggest to use runattargetfps so the "scanOCR" function is throttle to a lower fps

@mayran-logmanager
Copy link

@pedrol2b thx for the advice man. I tried what you said and it worked as expected.

@joacub
Copy link

joacub commented Apr 23, 2024

build in android is failing in react vision camera v4

unresolved reference:
import com.mrousavy.camera.frameprocessor.Frame

@ismaelsousa
Copy link
Author

build in android is failing in react vision camera v4

unresolved reference: import com.mrousavy.camera.frameprocessor.Frame

I am updating right now :) soon will be available

@joacub
Copy link

joacub commented Apr 23, 2024

build in android is failing in react vision camera v4
unresolved reference: import com.mrousavy.camera.frameprocessor.Frame

I am updating right now :) soon will be available

im waiting for you, ios works but notice that andorid didnt hahaha, thank you so much for you very quick response.

@pedrol2b
Copy link

pedrol2b commented Apr 23, 2024

build in android is failing in react vision camera v4
unresolved reference: import com.mrousavy.camera.frameprocessor.Frame

I am updating right now :) soon will be available

im waiting for you, ios works but notice that andorid didnt hahaha, thank you so much for you very quick response.

This issue with the Android build is due to the latest update of the react-native-vision (v4)
some exports were updated and need to be fixed in imports

Before:

 import com.mrousavy.camera.frameprocessor.Frame
 import com.mrousavy.camera.frameprocessor.FrameProcessorPlugin
 import com.mrousavy.camera.types.Orientation
 

Now:

 import com.mrousavy.camera.frameprocessors.Frame
 import com.mrousavy.camera.frameprocessors.FrameProcessorPlugin
 import com.mrousavy.camera.core.types.Orientation

Same as the orientation method toDegrees() used in OCRFrameProcessorPLugin.kt

@ismaelsousa
Copy link
Author

@joacub @pedrol2b could try out the pre release 3.0.0-0?

@pedrol2b
Copy link

@joacub @pedrol2b could try out the pre release 3.0.0-0?

Going to check it right now on android

@joacub
Copy link

joacub commented Apr 23, 2024

testing....

@joacub
Copy link

joacub commented Apr 23, 2024

it is working like a charm, in andorid i dont know why with a 2 fps runinng seems like doing some blocking task thatt freezes the camera por miliseconds, that happened before too, just comenting...

@ismaelsousa
Copy link
Author

Thanks for letting me know it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.