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

🐛 iOS 'react/bridging/CallbackWrapper.h' file not found #1413

Closed
3 of 4 tasks
salihgun opened this issue Jan 9, 2023 · 14 comments
Closed
3 of 4 tasks

🐛 iOS 'react/bridging/CallbackWrapper.h' file not found #1413

salihgun opened this issue Jan 9, 2023 · 14 comments
Labels
🐛 bug Something isn't working

Comments

@salihgun
Copy link

salihgun commented Jan 9, 2023

What were you trying to do?

I was trying to add the library but can not run it

Reproduceable Code

No response

What happened instead?

Screenshot 2023-01-09 at 16 26 30

Relevant log output

No response

Device

iPhone 14 (iOS 16.0)

VisionCamera Version

2.15.2

Additional information

@salihgun salihgun added the 🐛 bug Something isn't working label Jan 9, 2023
@luchozamora
Copy link

@salihgun make sure you are using SWIFT_VERSION = 5.2 in your project.
From react-native-camera's troubleshooting website:

3. iii. If the SWIFT_VERSION value is set, make sure it is set to 5.2 or higher.

@senrymori
Copy link

@salihgun make sure you are using SWIFT_VERSION = 5.2 in your project. From react-native-camera's troubleshooting website:

3. iii. If the SWIFT_VERSION value is set, make sure it is set to 5.2 or higher.

i raised the swift version to 5.2 but it doesn't work (xCode v14.2)

but this answer helped me: #1159 (comment)

when I raised the version to 5.2 and registered this in my Podfile, then the whole project was assembled

post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
        config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
        config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
        config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) '
        config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_ROOT)/Headers/Private/React-bridging/react/bridging" '
        config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_CONFIGURATION_BUILD_DIR)/React-bridging/react_bridging.framework/Headers" '    
       end
    end
  end

@myselfuser1
Copy link

@kesha-antonov
Copy link

Having this issue in RN 0.72.0

@kesha-antonov
Copy link

kesha-antonov commented Jun 23, 2023

In RN 0.72 paths changed. Here's fix:

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" '
    end
  end
end

@RRaideRR
Copy link

Small reproducible example - don't know if it helps you @mrousavy

https://github.com/RRaideRR/vision-camera-expo-sdk-49

I'm seeing this only when I enable "useFrameworks": "static"

@mrousavy
Copy link
Owner

Hey thanks!
I'm not sure if VisionCamera can build with static frameworks, let me investigate that in v3. Thanks for the repro!

@RRaideRR
Copy link

Hey thanks! I'm not sure if VisionCamera can build with static frameworks, let me investigate that in v3. Thanks for the repro!

before react-native 0.72.0 it did :-)

@RRaideRR
Copy link

RRaideRR commented Jun 29, 2023

For anyone also using expo SDK 49 or react native 0.72.0 with expo - here is what you need to do to modify the podfile:

  1. add a new file e.g. plugins/withPodfile.js
  2. in your app.json, add your plugin to the plugins key.
...
    "plugins": [
      [
        "./plugins/withPodfile"
      ],
...

This is how my podfile looks like - its my first config plugin, so not quite sure if this is well written but in my project it works :-)

const fs = require('fs');
const path = require('path');

const { withDangerousMod, withPlugins } = require('@expo/config-plugins');

async function readFile(path) {
  return fs.promises.readFile(path, 'utf8');
}

async function saveFile(path, content) {
  return fs.promises.writeFile(path, content, 'utf8');
}

module.exports = (config) =>
  withPlugins(config, [
    (config) => {
      return withDangerousMod(config, [
        'ios',
        async (config) => {
          const file = path.join(
            config.modRequest.platformProjectRoot,
            'Podfile',
          );
          const thingsToAdd =
            '  post_install do |installer|\n' +
            '  installer.pods_project.targets.each do |target|\n' +
            '    target.build_configurations.each do |config|\n' +
            "      config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) '\n" +
            "      config.build_settings['HEADER_SEARCH_PATHS'] << '\"${PODS_ROOT}/../../node_modules/react-native/ReactCommon\" '\n" +
            '    end\n' +
            '  end\n';

          // replaces the line post_install do |installer| with the content of thingsToAdd
          const contents = (await readFile(file)).replace(
            'post_install do |installer|\n',
            thingsToAdd,
          );
          /*
           * Now re-adds the content
           */
          await saveFile(file, contents);
          return config;
        },
      ]);
    },
  ]);


@kbrandwijk
Copy link
Sponsor

Are there any plans to fix this in the current VisionCamera version?

@mrousavy
Copy link
Owner

Hey @kbrandwijk - unfortunately not, no. I just can't focus on everything - I'm trying to plan my time as effective as possible and in V3 I'll do this - hope you understand

@kbrandwijk
Copy link
Sponsor

A little note in the readme that RN 0.71 is the last supported version might help in that case...

@mrousavy
Copy link
Owner

Closing as this is a stale issue - this might have been fixed with the full rewrite in VisionCamera V3 (🥳) - if not, please create a new issue.

If your issue has been fixed, consider sponsoring me on GitHub to say thanks 💖

@jackylu0124
Copy link

In RN 0.72 paths changed. Here's fix:

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" '
    end
  end
end

@kesha-antonov I have a quick question: should I put the code you mentioned before or after the react_native_post_install() and __apply_Xcode_12_5_M1_post_install_workaround() calls?

In other words, in my Podfile, should I do

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" '
    end
  end

  react_native_post_install(
    installer,
    config[:reactNativePath],
    :mac_catalyst_enabled => false
  )
  __apply_Xcode_12_5_M1_post_install_workaround(installer)
end

or should I do

post_install do |installer|
  react_native_post_install(
    installer,
    config[:reactNativePath],
    :mac_catalyst_enabled => false
  )
  __apply_Xcode_12_5_M1_post_install_workaround(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" '
    end
  end
end

Thanks a lot in advance!

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

9 participants