react-native-vision-camera: [V2] iOS - App Crashes at Launch when built with Xcode 15

What’s happening?

When built using Xcode 15 release candidate, the app is crashing at launch. Before the crash, the message Swift class extensions and categories on Swift classes are not allowed to have +load methods is printed to the console.

Relevant info - I’m also using vision-camera-code-scanner@0.2.0 for barcode scanning.

It seems to be related to https://github.com/mrousavy/react-native-vision-camera/pull/1308. If I revert that change, the startup crash goes away, but then when trying to use the camera it lags and then crashes (probably the original issue)

My workaround for now is continuing to use Xcode 14 to build.

Reproduceable Code

N/A

Relevant log output

Code Type:           X86-64 (Native)
Role:                Foreground
Parent Process:      launchd_sim [26423]
Coalition:           com.apple.CoreSimulator.SimDevice.249DDD8B-78A4-4847-98B3-29645FFF9567 [76346]
Responsible Process: SimulatorTrampoline [24850]

Date/Time:           2023-08-25 16:33:58.9305 -0400
Launch Time:         2023-08-25 16:33:57.5265 -0400
OS Version:          macOS 13.5.1 (22G90)
Release Type:        User
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: OBJC 1 

Triggered by Thread:  0

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	       0x114d49a52 __abort_with_payload + 10
1   libsystem_kernel.dylib        	       0x114d6784e abort_with_payload_wrapper_internal + 82
2   libsystem_kernel.dylib        	       0x114d677fc abort_with_reason + 19
3   libobjc.A.dylib               	    0x7ff800057593 _objc_fatalv(unsigned long long, unsigned long long, char const*, __va_list_tag*) + 121
4   libobjc.A.dylib               	    0x7ff80005751a _objc_fatal(char const*, ...) + 114
5   libobjc.A.dylib               	    0x7ff80004166d load_images + 1383
6   dyld_sim                      	       0x11389509b dyld4::RuntimeState::notifyObjCInit(dyld4::Loader const*) + 359
7   dyld_sim                      	       0x11389a73c dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 182
8   dyld_sim                      	       0x11389d49a dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const::$_1::operator()() const + 92
9   dyld_sim                      	       0x11389a7dd dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 93
10  dyld_sim                      	       0x1138b03df dyld4::APIs::runAllInitializersForMain() + 263
11  dyld_sim                      	       0x11388c10a dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 2535
12  dyld_sim                      	       0x11388b356 _dyld_sim_prepare + 854
13  dyld                          	       0x117f55424 dyld4::prepareSim(dyld4::RuntimeState&, char const*) + 1490
14  dyld                          	       0x117f53abc dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 249
15  dyld                          	       0x117f533bd start + 1805

Camera Device

N/A

Device

iPhone 14 Pro

VisionCamera Version

2.15.4

Can you reproduce this issue in the VisionCamera Example app?

  • I can reproduce the issue in the VisionCamera Example app.

Additional information

Upvote & Fund

  • We’re using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
<picture> <source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/api/github/mrousavy/react-native-vision-camera/issues/1802/pledge.svg?darkmode=1"> Fund with Polar </picture>

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Reactions: 25
  • Comments: 48 (2 by maintainers)

Commits related to this issue

Most upvoted comments

I’m on version 2.15.4 and had to replace

+(void)load

with

__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)()

in two lines in the file ./ios/Frame Processor/FrameProcessorPlugin.h:

https://github.com/mrousavy/react-native-vision-camera/blob/9963f4dedc6fbef933fb99e0adca1343f4f5f972/ios/Frame Processor/FrameProcessorPlugin.h#L36

https://github.com/mrousavy/react-native-vision-camera/blob/9963f4dedc6fbef933fb99e0adca1343f4f5f972/ios/Frame Processor/FrameProcessorPlugin.h#L56

This avoids the initial crash. Haven’t tried the camera which I assume will crash as stated in https://github.com/mrousavy/react-native-vision-camera/issues/1307#issuecomment-1727739161.

This patch worked for me!

react-native: 0.71.13 react-native-camera-vision: 2.15.4 xcode: 15 macos: 14.0

Create file patch with name -> ./patches/react-native-vision-camera+2.15.4.patch

Past content below to file

npx patch-package

diff --git a/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h b/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h
index 9408774..2aa04dc 100644
--- a/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h	
+++ b/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h	
@@ -33,7 +33,7 @@
  */
 #define VISION_EXPORT_FRAME_PROCESSOR(frame_processor)                              \
                                                                                     \
-+(void)load                                                                         \
+__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)()    \
 {                                                                                   \
   [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #frame_processor callback:^id(Frame* frame, NSArray<id>* args) { \
     return frame_processor(frame, args);                                           \
@@ -53,7 +53,7 @@ objc_name : NSObject<FrameProcessorPluginBase>
 @end                                                                                \
 @implementation objc_name (FrameProcessorPlugin)                                    \
                                                                                     \
-+(void)load                                                                          \
+__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)()    \
 {                                                                                   \
   [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #name callback:^id(Frame* frame, NSArray<id>* args) {    \
     return [objc_name callback:frame withArgs:args];                               \

Same issue after updating to xcode 15

So basically the breaking change from Xcode 13 -> 14 is now reverted with Xcode 14 -> 15? 😂

I’m on version 2.15.4 and had to replace

+(void)load

with

__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)()

in two lines in the file ./ios/Frame Processor/FrameProcessorPlugin.h:

https://github.com/mrousavy/react-native-vision-camera/blob/9963f4dedc6fbef933fb99e0adca1343f4f5f972/ios/Frame Processor/FrameProcessorPlugin.h#L36

https://github.com/mrousavy/react-native-vision-camera/blob/9963f4dedc6fbef933fb99e0adca1343f4f5f972/ios/Frame Processor/FrameProcessorPlugin.h#L56

This avoids the initial crash. Haven’t tried the camera which I assume will crash as stated in #1307 (comment).

Thank you, that’s worked for me!

Note: I am using RN 0.68.2 here.

@Thormeard, it’s final change, worked for me. But only to “react-native-vision-camera”: “2.15.2”, if I update “react-native-vision-camera” to 2.16.1 I got error(Frame processors not enabled) again, I don’t know why .

//
//  FrameProcessorPlugin.h
//  VisionCamera
//
//  Created by Marc Rousavy on 01.05.21.
//  Copyright © 2021 mrousavy. All rights reserved.
//

#ifndef FrameProcessorPlugin_h
#define FrameProcessorPlugin_h

#import <Foundation/Foundation.h>
#import "FrameProcessorPluginRegistry.h"
#import "Frame.h"

@protocol FrameProcessorPluginBase
+ (id) callback:(Frame*)frame withArgs:(NSArray<id>*)args;
@end


#define VISION_CONCAT2(A, B) A##B
#define VISION_CONCAT(A, B) VISION_CONCAT2(A, B)

/**
 * Use this Macro to register the given function as a Frame Processor.
 * * Make sure the given function is a C-style function with the following signature: static inline id callback(Frame* frame, NSArray* args)
 * * Make sure the given function's name is unique across other frame processor plugins
 * * Make sure your frame processor returns a Value that can be converted to JS
 * * Make sure to use this Macro in an @implementation, not @interface
 *
 * The JS function will have the same name as the given Objective-C function, but with a "__" prefix.
 * Make sure to add that function to the babel.config.js under reanimated's "globals" option, and add TypeScript type declarations.
 */
#define VISION_EXPORT_FRAME_PROCESSOR(frame_processor)                              \
                                                                                    \
+(void)load                                                                         \
{                                                                                   \
  [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #frame_processor callback:^id(Frame* frame, NSArray<id>* args) { \
    return frame_processor(frame, args);                                           \
  }];                                                                               \
}


/**
 * Same as VISION_EXPORT_FRAME_PROCESSOR, but uses __attribute__((constructor)) for
 * registration. Useful for registering swift classes that forbids use of +(void)load.
 */
#define VISION_EXPORT_SWIFT_FRAME_PROCESSOR(name, objc_name) \
objc_name : NSObject<FrameProcessorPluginBase>                                      \
@end                                                                                \
                                                                                    \
@interface objc_name (FrameProcessorPlugin) <FrameProcessorPluginBase>                                         \
@end                                                                                \
@implementation objc_name (FrameProcessorPlugin)                                    \
                                                                                    \
__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)() \
{                                                                                   \
  [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #name callback:^id(Frame* frame, NSArray<id>* args) {    \
    return [objc_name callback:frame withArgs:args];                               \
  }];                                                                               \
}

#endif /* FrameProcessorPlugin_h */

If you have patch-package you can apply this:

diff --git a/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h b/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h
index 9408774..64180c7 100644
--- a/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h	
+++ b/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h	
@@ -49,11 +49,11 @@
 objc_name : NSObject<FrameProcessorPluginBase>                                      \
 @end                                                                                \
                                                                                     \
-@interface objc_name (FrameProcessorPlugin)                                         \
+@interface objc_name (FrameProcessorPlugin) <FrameProcessorPluginBase>                                         \
 @end                                                                                \
 @implementation objc_name (FrameProcessorPlugin)                                    \
                                                                                     \
-+(void)load                                                                          \
+__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)() \
 {                                                                                   \
   [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #name callback:^id(Frame* frame, NSArray<id>* args) {    \
     return [objc_name callback:frame withArgs:args];                               \

Also If you have firebase with use_frameworks! :linkage => :static in your pods this can help you (this case give same error: Frame processors not enabled ):

pre_install do |installer|
    installer.pod_targets.each do |pod|
      if pod.name.eql?('VisionCamera') || pod.name.eql?('RNReanimated')
        Pod::UI.puts "#{pod.name}: Using overridden static_framework value of 'true'"
        def pod.build_type
          Pod::BuildType.static_library
        end
      end
    end
  end

https://github.com/mrousavy/react-native-vision-camera/issues/1840#issuecomment-1734259756

Same issue here. It works with Xcode 14, but can’t build for iOS 17.

Facing the same issue. App crashes on launch.

Yep, same issue. Xcode 15 (15A240d).

Facing the same issue! Any workarounds for this on xcode 15?

@Thormeard, it’s final change, worked for me. But only to “react-native-vision-camera”: “2.15.2”, if I update “react-native-vision-camera” to 2.16.1 I got error(Frame processors not enabled) again, I don’t know why .

//
//  FrameProcessorPlugin.h
//  VisionCamera
//
//  Created by Marc Rousavy on 01.05.21.
//  Copyright © 2021 mrousavy. All rights reserved.
//

#ifndef FrameProcessorPlugin_h
#define FrameProcessorPlugin_h

#import <Foundation/Foundation.h>
#import "FrameProcessorPluginRegistry.h"
#import "Frame.h"

@protocol FrameProcessorPluginBase
+ (id) callback:(Frame*)frame withArgs:(NSArray<id>*)args;
@end


#define VISION_CONCAT2(A, B) A##B
#define VISION_CONCAT(A, B) VISION_CONCAT2(A, B)

/**
 * Use this Macro to register the given function as a Frame Processor.
 * * Make sure the given function is a C-style function with the following signature: static inline id callback(Frame* frame, NSArray* args)
 * * Make sure the given function's name is unique across other frame processor plugins
 * * Make sure your frame processor returns a Value that can be converted to JS
 * * Make sure to use this Macro in an @implementation, not @interface
 *
 * The JS function will have the same name as the given Objective-C function, but with a "__" prefix.
 * Make sure to add that function to the babel.config.js under reanimated's "globals" option, and add TypeScript type declarations.
 */
#define VISION_EXPORT_FRAME_PROCESSOR(frame_processor)                              \
                                                                                    \
+(void)load                                                                         \
{                                                                                   \
  [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #frame_processor callback:^id(Frame* frame, NSArray<id>* args) { \
    return frame_processor(frame, args);                                           \
  }];                                                                               \
}


/**
 * Same as VISION_EXPORT_FRAME_PROCESSOR, but uses __attribute__((constructor)) for
 * registration. Useful for registering swift classes that forbids use of +(void)load.
 */
#define VISION_EXPORT_SWIFT_FRAME_PROCESSOR(name, objc_name) \
objc_name : NSObject<FrameProcessorPluginBase>                                      \
@end                                                                                \
                                                                                    \
@interface objc_name (FrameProcessorPlugin) <FrameProcessorPluginBase>                                         \
@end                                                                                \
@implementation objc_name (FrameProcessorPlugin)                                    \
                                                                                    \
__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)() \
{                                                                                   \
  [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #name callback:^id(Frame* frame, NSArray<id>* args) {    \
    return [objc_name callback:frame withArgs:args];                               \
  }];                                                                               \
}

#endif /* FrameProcessorPlugin_h */

If you have patch-package you can apply this:

diff --git a/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h b/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h
index 9408774..64180c7 100644
--- a/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h	
+++ b/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h	
@@ -49,11 +49,11 @@
 objc_name : NSObject<FrameProcessorPluginBase>                                      \
 @end                                                                                \
                                                                                     \
-@interface objc_name (FrameProcessorPlugin)                                         \
+@interface objc_name (FrameProcessorPlugin) <FrameProcessorPluginBase>                                         \
 @end                                                                                \
 @implementation objc_name (FrameProcessorPlugin)                                    \
                                                                                     \
-+(void)load                                                                          \
+__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)() \
 {                                                                                   \
   [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #name callback:^id(Frame* frame, NSArray<id>* args) {    \
     return [objc_name callback:frame withArgs:args];                               \

Also If you have firebase with use_frameworks! :linkage => :static in your pods this can help you (this case give same error: Frame processors not enabled ):

pre_install do |installer|
    installer.pod_targets.each do |pod|
      if pod.name.eql?('VisionCamera') || pod.name.eql?('RNReanimated')
        Pod::UI.puts "#{pod.name}: Using overridden static_framework value of 'true'"
        def pod.build_type
          Pod::BuildType.static_library
        end
      end
    end
  end

#1840 (comment)

And to make v2 work on iPhone 15 you need to add the following to your patch, and build using xcode 15/ios skd 17

diff --git a/node_modules/react-native-vision-camera/ios/Parsers/AVCaptureColorSpace+descriptor.swift b/node_modules/react-native-vision-camera/ios/Parsers/AVCaptureColorSpace+descriptor.swift
index 13a403b..9b30f62 100644
--- a/node_modules/react-native-vision-camera/ios/Parsers/AVCaptureColorSpace+descriptor.swift
+++ b/node_modules/react-native-vision-camera/ios/Parsers/AVCaptureColorSpace+descriptor.swift
@@ -24,6 +24,13 @@ extension AVCaptureColorSpace {
     case "srgb":
       self = .sRGB
       return
+    case "appleLog":
+        if #available(iOS 17, *) {
+          self = .appleLog
+        } else {
+          throw EnumParserError.unsupportedOS(supportedOnOS: "17")
+        }
+        return
     default:
       throw EnumParserError.invalidValue
     }
@@ -37,6 +44,8 @@ extension AVCaptureColorSpace {
       return "p3-d65"
     case .sRGB:
       return "srgb"
+    case .appleLog:
+        return "appleLog"
     default:
       fatalError("AVCaptureDevice.Position has unknown state.")
     }

Hi, got the same issue. (2.16.1) Managed to fix crashing on startup with https://github.com/mrousavy/react-native-vision-camera/issues/1307#issuecomment-1731248952 But still got an error when trying to use frame processor: frame-processor/unavailable: Frame Processors are not enabled.

Anything else im missing?

My FrameProcessorPlugin.h

//
//  FrameProcessorPlugin.h
//  VisionCamera
//
//  Created by Marc Rousavy on 01.05.21.
//  Copyright © 2021 mrousavy. All rights reserved.
//

#ifndef FrameProcessorPlugin_h
#define FrameProcessorPlugin_h

#import <Foundation/Foundation.h>
#import "FrameProcessorPluginRegistry.h"
#import "Frame.h"

@protocol FrameProcessorPluginBase
+ (id) callback:(Frame*)frame withArgs:(NSArray<id>*)args;
@end


#define VISION_CONCAT2(A, B) A##B
#define VISION_CONCAT(A, B) VISION_CONCAT2(A, B)

/**
 * Use this Macro to register the given function as a Frame Processor.
 * * Make sure the given function is a C-style function with the following signature: static inline id callback(Frame* frame, NSArray* args)
 * * Make sure the given function's name is unique across other frame processor plugins
 * * Make sure your frame processor returns a Value that can be converted to JS
 * * Make sure to use this Macro in an @implementation, not @interface
 *
 * The JS function will have the same name as the given Objective-C function, but with a "__" prefix.
 * Make sure to add that function to the babel.config.js under reanimated's "globals" option, and add TypeScript type declarations.
 */
#define VISION_EXPORT_FRAME_PROCESSOR(frame_processor)                              \
                                                                                    \
+(void)load                                                                         \
{                                                                                   \
  [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #frame_processor callback:^id(Frame* frame, NSArray<id>* args) { \
    return frame_processor(frame, args);                                           \
  }];                                                                               \
}


/**
 * Same as VISION_EXPORT_FRAME_PROCESSOR, but uses __attribute__((constructor)) for
 * registration. Useful for registering swift classes that forbids use of +(void)load.
 */
#define VISION_EXPORT_SWIFT_FRAME_PROCESSOR(name, objc_name)                        \
objc_name : NSObject<FrameProcessorPluginBase>                                      \
@end                                                                                \
                                                                                    \
@interface objc_name (FrameProcessorPlugin) <FrameProcessorPluginBase>              \
@end                                                                                \
@implementation objc_name (FrameProcessorPlugin)                                    \
                                                                                    \
__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)()    \
{                                                                                   \
  [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #name callback:^id(Frame* frame, NSArray<id>* args) {    \
    return [objc_name callback:frame withArgs:args];                               \
  }];                                                                               \
}

#endif /* FrameProcessorPlugin_h */

@gabrielmaldi @DanielAraldi be warned (I mentioned this in my original comment), the reversion fixes the startup crash but the original crash (using the camera with a frame processor) will pop back up, making the fix unusable

The quick fix for now is to revert this change - https://github.com/mrousavy/react-native-vision-camera/pull/1308/files

Replacing vision-camera-code-scanner with react-native-camera-kit.

That solved the issue for me.

@ms314006 Just keep using Xcode 14 for now. I recommend using https://github.com/XcodesOrg/xcodes to manage Xcode versions. But we need to get this resolved eventually, because at some point next year Apple will likely require Xcode 15 for submissions.

@phatmovista Yes, but unfortunately reverting it is not an option because the app crashes when using the camera (the original reason the change was put in: https://github.com/mrousavy/react-native-vision-camera/pull/1308)

Same issue after updating to xcode 15

Same issue here 😭, This message is printed to the xcode15 console before crashed:

Screenshot 2023-09-19 at 11 36 56 PM

@marcshilling Do you have any solution for the issue? I will be grateful for anything you can reply. 🙏

gettins this issue also on xcode 15 + iOS 17+ vision camera 3.3.1.

Hey - yea please submit a PR instead of creating random patches. Then I can merge and backport it.

@Thormeard, it’s final change, worked for me. But only to “react-native-vision-camera”: “2.15.2”, if I update “react-native-vision-camera” to 2.16.1 I got error(Frame processors not enabled) again, I don’t know why .

//
//  FrameProcessorPlugin.h
//  VisionCamera
//
//  Created by Marc Rousavy on 01.05.21.
//  Copyright © 2021 mrousavy. All rights reserved.
//

#ifndef FrameProcessorPlugin_h
#define FrameProcessorPlugin_h

#import <Foundation/Foundation.h>
#import "FrameProcessorPluginRegistry.h"
#import "Frame.h"

@protocol FrameProcessorPluginBase
+ (id) callback:(Frame*)frame withArgs:(NSArray<id>*)args;
@end


#define VISION_CONCAT2(A, B) A##B
#define VISION_CONCAT(A, B) VISION_CONCAT2(A, B)

/**
 * Use this Macro to register the given function as a Frame Processor.
 * * Make sure the given function is a C-style function with the following signature: static inline id callback(Frame* frame, NSArray* args)
 * * Make sure the given function's name is unique across other frame processor plugins
 * * Make sure your frame processor returns a Value that can be converted to JS
 * * Make sure to use this Macro in an @implementation, not @interface
 *
 * The JS function will have the same name as the given Objective-C function, but with a "__" prefix.
 * Make sure to add that function to the babel.config.js under reanimated's "globals" option, and add TypeScript type declarations.
 */
#define VISION_EXPORT_FRAME_PROCESSOR(frame_processor)                              \
                                                                                    \
+(void)load                                                                         \
{                                                                                   \
  [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #frame_processor callback:^id(Frame* frame, NSArray<id>* args) { \
    return frame_processor(frame, args);                                           \
  }];                                                                               \
}


/**
 * Same as VISION_EXPORT_FRAME_PROCESSOR, but uses __attribute__((constructor)) for
 * registration. Useful for registering swift classes that forbids use of +(void)load.
 */
#define VISION_EXPORT_SWIFT_FRAME_PROCESSOR(name, objc_name) \
objc_name : NSObject<FrameProcessorPluginBase>                                      \
@end                                                                                \
                                                                                    \
@interface objc_name (FrameProcessorPlugin) <FrameProcessorPluginBase>                                         \
@end                                                                                \
@implementation objc_name (FrameProcessorPlugin)                                    \
                                                                                    \
__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)() \
{                                                                                   \
  [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #name callback:^id(Frame* frame, NSArray<id>* args) {    \
    return [objc_name callback:frame withArgs:args];                               \
  }];                                                                               \
}

#endif /* FrameProcessorPlugin_h */

If you have patch-package you can apply this:

diff --git a/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h b/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h
index 9408774..64180c7 100644
--- a/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h	
+++ b/node_modules/react-native-vision-camera/ios/Frame Processor/FrameProcessorPlugin.h	
@@ -49,11 +49,11 @@
 objc_name : NSObject<FrameProcessorPluginBase>                                      \
 @end                                                                                \
                                                                                     \
-@interface objc_name (FrameProcessorPlugin)                                         \
+@interface objc_name (FrameProcessorPlugin) <FrameProcessorPluginBase>                                         \
 @end                                                                                \
 @implementation objc_name (FrameProcessorPlugin)                                    \
                                                                                     \
-+(void)load                                                                          \
+__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)() \
 {                                                                                   \
   [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #name callback:^id(Frame* frame, NSArray<id>* args) {    \
     return [objc_name callback:frame withArgs:args];                               \

Also If you have firebase with use_frameworks! :linkage => :static in your pods this can help you (this case give same error: Frame processors not enabled ):

pre_install do |installer|
    installer.pod_targets.each do |pod|
      if pod.name.eql?('VisionCamera') || pod.name.eql?('RNReanimated')
        Pod::UI.puts "#{pod.name}: Using overridden static_framework value of 'true'"
        def pod.build_type
          Pod::BuildType.static_library
        end
      end
    end
  end

#1840 (comment)

Can confirm, fixes issue for me BUT only on 2.15.2 (not on latest 2.16.1). Thanks!

Xcode 15, ios 17, iPhone X

crash is resolved with this. thx

__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)()

however I can’t use camera.

"react-native-vision-camera": "2.16.1",
"react-native": "0.68.7",
__attribute__((constructor)) static void VISION_CONCAT(initialize_, objc_name)() \
{                                                                                   \
  [FrameProcessorPluginRegistry addFrameProcessorPlugin:@"__" @ #name callback:^id(Frame* frame, NSArray<id>* args) {    \
    return [objc_name callback:frame withArgs:args];                               \
  }];                                                                               \
}

Screenshot 2023-09-21 at 11 21 36 PM

Yes, this is a temporary fix to be able to at least work on the rest of the app. Thanks a lot.