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

🐛 'react/bridging/CallbackWrapper.h' file not found [SOLVED] #1121

Closed
3 of 4 tasks
luisfuertes opened this issue Jul 6, 2022 · 37 comments
Closed
3 of 4 tasks

🐛 'react/bridging/CallbackWrapper.h' file not found [SOLVED] #1121

luisfuertes opened this issue Jul 6, 2022 · 37 comments
Labels
🐛 bug Something isn't working

Comments

@luisfuertes
Copy link

What were you trying to do?

Im trying to install the library, i think i follow all steps and all iOS troubleshooting section. I have tried with react-native-reanimated and without it. But always have the same issue

Captura de Pantalla 2022-07-06 a las 16 05 08

Reproduceable Code

"react": "18.0.0",
    "react-native": "0.69.1",
    "react-native-reanimated": "^2.9.1",
    "react-native-vision-camera": "^2.13.5"

What happened instead?

iOS build error

Relevant log output

/myApp/node_modules/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h:16:10: 'react/bridging/CallbackWrapper.h' file not found

Device

iPhone 11 simulator and iPhone Xr device

VisionCamera Version

"react-native-vision-camera": "^2.13.5"

Additional information

@luisfuertes luisfuertes added the 🐛 bug Something isn't working label Jul 6, 2022
@luisfuertes
Copy link
Author

luisfuertes commented Jul 6, 2022

And on Android

A problem occurred evaluating project ':react-native-vision-camera'.
> Expected directory '/myApp/node_modules/react-native/android' to contain exactly one file, however, it contains more than one file.

And in node_modules/react-native-vision-camera/android

Captura de Pantalla 2022-07-06 a las 16 31 22

@kierancrown
Copy link

kierancrown commented Jul 6, 2022

I am also experiencing both these issues since upgrading to RN 0.69. I think this may be related to this.

@luisfuertes
Copy link
Author

luisfuertes commented Jul 7, 2022

@kierancrown do you know some hotfix for that?

EDIT: I init my project with react native 0.68 version to avoid that issue xd

@kierancrown
Copy link

@kierancrown do you know some hotfix for that?

EDIT: I init my project with react native 0.68 version to avoid that issue xd

I actually managed to get this working by applying two patches.

RN-Vision-Patches.zip

I can't get the QR Code frame processor working however. See this issue here.

@luisfuertes
Copy link
Author

Thanks!

I'm going to implement my own frame processor so no problem. I recommend you to implement your own frame processor to read QRs, its very easy

@luisfuertes
Copy link
Author

I apply only the pach for react-native-vision-camera and it didnt work :(

@kierancrown
Copy link

Thanks!

I'm going to implement my own frame processor so no problem. I recommend you to implement your own frame processor to read QRs, its very easy

Do you have any links or articles? You might need to apply both. I'll check my code and get back to you!

@luisfuertes
Copy link
Author

luisfuertes commented Jul 7, 2022

With example project and this docs is very easy
https://github.com/mrousavy/react-native-vision-camera/tree/main/example

https://mrousavy.com/react-native-vision-camera/docs/guides/frame-processors-plugins-ios
https://mrousavy.com/react-native-vision-camera/docs/guides/frame-processors-plugins-android

Only need a native library to recognize QR from UIImage. U can transform frame to UIImage with this code

  CVPixelBufferRef frameBuffer = CMSampleBufferGetImageBuffer(frame.buffer);
  CIImage *ciImage = [CIImage imageWithCVPixelBuffer:frameBuffer];
  UIImage *uiImage = [[UIImage alloc] initWithCIImage:ciImage];

@luisfuertes
Copy link
Author

I start new project on RN 0.69.1 and add your patches, but i get the same error :s

I add some info

    node v16.15.1
    cocoapods v1.11.3

    "react": "18.0.0",
    "react-native": "0.69.1",
    "react-native-vision-camera": "^2.13.5"

@kierancrown
Copy link

I start new project on RN 0.69.1 and add your patches, but i get the same error :s

I add some info

    node v16.15.1
    cocoapods v1.11.3

    "react": "18.0.0",
    "react-native": "0.69.1",
    "react-native-vision-camera": "^2.13.5"

Try this facebook/react-native#34102 (comment)

@luisfuertes
Copy link
Author

iOS error fixed on 0.68.2 and 0.69.1 with ur last patch. Thanks!

@kierancrown
Copy link

I start new project on RN 0.69.1 and add your patches, but i get the same error :s

I add some info

    node v16.15.1
    cocoapods v1.11.3

    "react": "18.0.0",
    "react-native": "0.69.1",
    "react-native-vision-camera": "^2.13.5"

No worries, I haven't tested with Android yet, still looking into a frame processor.

@luisfuertes
Copy link
Author

 

#import "CVWrapper.h"
#import <Foundation/Foundation.h>
#import <VisionCamera/FrameProcessorPlugin.h>
#import <VisionCamera/Frame.h>

@interface FrameProcessorPlugin : NSObject
@end

@implementation FrameProcessorPlugin

static inline id frameProcessorPlugin(Frame* frame, NSArray* arguments) {
  CVPixelBufferRef frameBuffer = CMSampleBufferGetImageBuffer(frame.buffer);
  CIImage *ciImage = [CIImage imageWithCVPixelBuffer:frameBuffer];


  NSDictionary* options;
  CIContext* context = [CIContext context];
  options = @{ CIDetectorAccuracy : CIDetectorAccuracyHigh }; // Slow but thorough
  //options = @{ CIDetectorAccuracy : CIDetectorAccuracyLow}; // Fast but superficial

  CIDetector* qrDetector = [CIDetector detectorOfType:CIDetectorTypeQRCode
                                              context:context
                                              options:options];
  if ([[ciImage properties] valueForKey:(NSString*) kCGImagePropertyOrientation] == nil) {
      options = @{ CIDetectorImageOrientation : @1};
  } else {
      options = @{ CIDetectorImageOrientation : [[ciImage properties] valueForKey:(NSString*) kCGImagePropertyOrientation]};
  }

  NSArray * features = [qrDetector featuresInImage:ciImage
                                           options:options];

  if (features != nil && features.count > 0) {
      for (CIQRCodeFeature* qrFeature in features) {
          NSLog(@"QRFeature.messageString : %@ ", qrFeature.messageString);
          return @{
                    @"qr": qrFeature.messageString,
          };
      }
  }
  

}

VISION_EXPORT_FRAME_PROCESSOR(qrPlugin)

@end

Try your own frame processor like this on iOS

@luisfuertes luisfuertes changed the title 🐛 'react/bridging/CallbackWrapper.h' file not found 🐛 'react/bridging/CallbackWrapper.h' file not found [SOLVED] Jul 8, 2022
@hengkx
Copy link

hengkx commented Jul 21, 2022

0.69.2 same error

@mocanSergiu666
Copy link

"react": "18.0.0",
"react-native": "0.69.2",
"react-native-vision-camera": "^2.14.0"
It's the same error :. (

@mocanSergiu666
Copy link

Is anyone working on this issue? :)

@KZCOWIOT
Copy link

i am using react-native 0.69.5 and still facing the same issue
'react/bridging/CallbackWrapper.h' file not found

@anveshbabu
Copy link

Hi any one Help this
i am using react-native 0.70.6 and still facing the same issue

'react/bridging/CallbackWrapper.h' file not found
image

@SamiChab
Copy link

SamiChab commented Aug 6, 2023

Any update on this ? I am also facing this same issue
react-native 0.72.3
react-native-vision-camera 2.15.5

1 similar comment
@asifbadeghar54
Copy link

Any update on this ? I am also facing this same issue
react-native 0.72.3
react-native-vision-camera 2.15.5

@asifiqubal
Copy link

Any update on this ? I am also facing this same issue react-native 0.72.3 react-native-vision-camera 2.15.5

Same with me.

@jonjamz
Copy link

jonjamz commented Aug 13, 2023

I started having this issue after upgrading from Expo SDK 48 to 49. From what I've read, the issue is with RN 0.72. I did not have any problems while using RN 0.71. Had to revert for now.

@vitas61
Copy link

vitas61 commented Aug 16, 2023

fix for rn 0.72.4, react-native-vision-camera 2.15.5 and react-native-reanimated 2.17.5

with use_frameworks!

update your Podfile

`
post_install do |installer|
installer.pods_project.targets.each do |target|
..

target.build_configurations.each do |config|
config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) '
config.build_settings['HEADER_SEARCH_PATHS'] << '"${PODS_ROOT}/../../node_modules/react-native/ReactCommon" '
if target.name === "RNReanimated"
config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17'
end
end

..

`

@jonjamz
Copy link

jonjamz commented Aug 16, 2023

How can I do this using Expo?

@vitas61
Copy link

vitas61 commented Aug 16, 2023

How can I do this using Expo?

@jonjamz
#1413 (comment)

@subirats345
Copy link

Same for me, on react-native 0.70.6 and react-native-vision-camera 2.15.6

@rosendosalazarbta
Copy link

rosendosalazarbta commented Aug 22, 2023

Any update on this? I'm also facing this same issue.
react-native: 0.72.4
react-native-vision-camera: 2.15.6

@sravis02
Copy link

same for me with
"react-native": "0.72.4",
"react-native-vision-camera": "^3.0.0",

@brascene
Copy link

Same here:
"react-native": "0.72.4",
"react-native-vision-camera": "^2.16.1"

@jeemercado
Copy link

fix for rn 0.72.4, react-native-vision-camera 2.15.5 and react-native-reanimated 2.17.5

with use_frameworks!

update your Podfile

` post_install do |installer| installer.pods_project.targets.each do |target| ..

target.build_configurations.each do |config| config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) ' config.build_settings['HEADER_SEARCH_PATHS'] << '"${PODS_ROOT}/../../node_modules/react-native/ReactCommon" ' if target.name === "RNReanimated" config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17' end end

..

`

this worked for me thanks!

@junaid7898
Copy link

junaid7898 commented Nov 18, 2023

fix for rn 0.72.4, react-native-vision-camera 2.15.5 and react-native-reanimated 2.17.5

with use_frameworks!

update your Podfile

` post_install do |installer| installer.pods_project.targets.each do |target| ..

target.build_configurations.each do |config| config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) ' config.build_settings['HEADER_SEARCH_PATHS'] << '"${PODS_ROOT}/../../node_modules/react-native/ReactCommon" ' if target.name === "RNReanimated" config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17' end end

..

`

when i do pod-install after updating my pod file with this code, it is taking a very long time and I am keep getting this
"Setting REACT_NATIVE build settings
Setting CLANG_CXX_LANGUAGE_STANDARD to c++17 on /Users/my-project/ios/my-project.xcodeproj"
and it keeps happening everytime i run pod install..... Do i need to remove it once I did pod install after updating podfile with the code above???? my code is bellow

post_install do |installer|
installer.pods_project.targets.each do |target|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
target.build_configurations.each do |config|
config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) '
config.build_settings['HEADER_SEARCH_PATHS'] << '"${PODS_ROOT}/../../node_modules/react-native/ReactCommon" '
if target.name === "RNReanimated"
config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17'
end
end
end
end

@sanderdewilde
Copy link

Also having this issue (using use_frameworks! :linkage => :static for firebase), with
"react-native": "0.72.7",
"react-native-vision-camera": "^3.6.12",

@NathanielNLA
Copy link

facebook/react-native#34102 (comment)

Same here!

@NathanielNLA
Copy link

fix for rn 0.72.4, react-native-vision-camera 2.15.5 and react-native-reanimated 2.17.5

with use_frameworks!

update your Podfile

` post_install do |installer| installer.pods_project.targets.each do |target| ..

target.build_configurations.each do |config| config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) ' config.build_settings['HEADER_SEARCH_PATHS'] << '"${PODS_ROOT}/../../node_modules/react-native/ReactCommon" ' if target.name === "RNReanimated" config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17' end end

..

`

This worked for me as well...

@sekhuat
Copy link

sekhuat commented Jan 14, 2024

I also faced the same issue and I am using react-native-vision-camera ver 2.16.1. I solved the issue by adding s.dependency "ReactCommon" into the node_modules/react-native-vision-camera/VisionCamera.podspec at the last line as shown below.

Pod::Spec.new do |s|
  ...
  s.dependency "React-callinvoker"
  s.dependency "React"
  s.dependency "React-Core"
  s.dependency "ReactCommon"    <== Add this line
end

After made the changes, I execute pod install command then recompile the app again. Hope this will help those who using V2 of react-native-vision-camera.

@AndersonD4vid
Copy link

s.dependency "ReactCommon"

Thank youuuuuuuu, this really helped me!

@nduyvu1511
Copy link

I also faced the same issue and I am using react-native-vision-camera ver 2.16.1. I solved the issue by adding s.dependency "ReactCommon" into the node_modules/react-native-vision-camera/VisionCamera.podspec at the last line as shown below.

Pod::Spec.new do |s|
  ...
  s.dependency "React-callinvoker"
  s.dependency "React"
  s.dependency "React-Core"
  s.dependency "ReactCommon"    <== Add this line
end

After made the changes, I execute pod install command then recompile the app again. Hope this will help those who using V2 of react-native-vision-camera.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests