-
Notifications
You must be signed in to change notification settings - Fork 24k
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
Error 'ReactCommon/TurboModuleBinding.h' file not found on react native 0.72.0 on iOS #38067
Comments
can you try using |
my ~/.zshrc looks like this:
Do you know how I can make it work? |
I checked and cocoapods has been installed properly but I'm still having the same error @cipolleschi |
Does it happens to you in a newly created project? If you do I'm trying to understand what's going on, because I can't repro the issue. |
I tried creating a new repo, and I used It works fine on another project indeed! Don't really know what to change in my current project to make it work then 😬 |
Yep, very likely so. My suggestion now would be to start adding one change at the time and try |
I'm having the same problem, tried bundle install but it is not fixing it, if anyone has a clue |
I am also facing the same issue. Any workaround? |
I double checked that I disabled both hermes and fabric in my podfile:
so I dont know why turbomodules would be imported
I'm running 0.72.1 |
Turbomodules are part of React Native and used by React Native even when the New Architecture is not fully enabled, that's why they are included. Have you disabled Flipper? It is not compatible with The best suggestion is to start with a fresh project and try to add one dep at the time to understand what breaks the app. We are running test in CI for a vanilla app with static frameworks and they are passing, so React Native works properly with that set up. There should be some dependency which is misconfigured. |
here is my podfile
I just tried to run |
Hi, ok, there are a couple of more things:
|
|
could it be that the folder structure of our app has an extra folder ? our folder structure is like this:
so it could cause problems with this maybe ?
our folder structure has not changed and everything worked in previous versions, thagts the only change linked to flder structure in 0.72 |
Ok I found the problem, hopefully if someone ends up here this will provide some pointers: the problem came from the RN post install not being run, this part:
I barely understand how RN works but it seems like thanks @cipolleschi for your time, have a great day! |
Actually, in your podfile, you used to have:
with no call to the This is not really a React Native (RN) specific thing, but it is how React Native is integrated with Cocoapods (CP) . CP is mainly used to install dependencies: you specify the dependencies needed in your project and CP downloads and install them, creating a separate Pods project and a workspace for your code to work with the new Pods project. Then, there could be the need to customize the Pods project and the workspace. CP offers RN exposes 2 functions:
Both functions must be called to have a properly initialized project. I hope this helps to shed some light on how the framework works! :D |
@cipolleschi I have both |
|
@chelovekdrakon I'm sorry that this is happening.
If it is working with a newly created project, I think that the issue is in the local configuration of the podfile or of the project. What are the differences between the two podfiles? Alternatively, I can investigate the issue if you can create a reproducer using this repo. The more likely issue is that:
|
@cipolleschi thanks a lot for your empathy and willingness to help! I could solve the issue by updating With Thanks a lot! |
Hi @chelovekdrakon I have a same error while upgrading expo from 48 to 49 'ReactCommon/RCTTurboModule.h' file not found I created a seperate issue about that. Can you walk us through on how you solved the issue? Here's the link expo#23809 |
@buscanopaul sure! |
@chelovekdrakon would you mind open PRs on those repository with the fixes so that newer releases of the libraries would not suffer from this problem? |
@cipolleschi I worry, that it might break compatibility, because it worked for me before upgrade... |
@cipolleschi but Sure, I will 👍 👍 |
the thing is that we made some changes between 0.71 and 0.72 in the cocoapods setup in order to support use_frameworks in the New Architecture. So it was expected that some libraries would break and need an update. 😉 |
I have the same question. |
how to do ? |
my podfile: require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
platform :ios, min_ios_version_supported
prepare_react_native_project!
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
target 'AwesomeP1' do
config = use_native_modules!
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
:flipper_configuration => flipper_config,
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'AwesomeP1Tests' do
inherit! :complete
end
post_install do |installer|
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end |
Hello everyone, we have update the react version to 0.72 (We use Xcode 14.2) and we get the same issue like you. this our podfile post installer script
I see that the issue is already open but maybe someone had fixed it hopefully. regards :) |
@sassiwalid can you create a reproducer for it? Which version of Cocoapods are you using? |
@cipolleschi we use the 1.12.1. |
Same one we use in ci and internally. So, if you can create a reproducer using https://github.com/react-native-community/reproducer-react-native, I would be able to investigate what's going on. I expect that there is some 3rd party library that is messing with the dependencies. |
Hello @cipolleschi thank you what I made and It's work fine for me
I used config = use_native_modules! to get the appropriate config because my projet uses a native swift package (this is my interpretation for the error) otherwhise I used the 0.72.4 version sadly. I can't use the last version 0.72.5. |
I understand. Potentially, you can uplift the I'm curious, why you can't use 0.72.5? |
I tried to implement the post install process like this and the app built successfully with me also, I am using firebase libraries and I'm not using flipper: Add this block above the target block: config = use_native_modules!
post_install do |installer_representation|
react_native_post_install(
installer_representation,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer_representation)
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
if target.name == 'image-slider'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'No'
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'No'
end
end
end Also I ran pod install like this: NO_FLIPPER=1 npx pod-install and I adjusted the react-native-config.js to be like this: |
@assadminhas we are also facing the same issue. Not sure what's going wrong. We are also not upgrading to the New Architecture, not using Flipper and it always gives the error for turbo module file not found. If anyone has worked out a solution for this, please let us know over here 😪 |
The reason why it is failing is probably because there is some library that is not configured properly. The root cause of this problem is the same as #38283 so, please, keep an eye on that issue for a solution. For the time being:
Please, try to reproduce the issue on a clean app. If you can't reproduce it, it is likely that your setup is not correct and it is not a React Native issue. |
Can someone please explain what the resolution of the issue was for I am still having the issue and tried RN versions 0.72.2 - 0.72.7 |
inside of target. Basically "react_native_post_install( |
@assadminhas Do we have to use Or can I use a path string |
reactNativePath is a symbol on the config hash and thats how hash keys are accessed in Ruby, by symbol If you are facing error with it then make sure to define
in the target. Please go through this Podfile to get an idea how it should look like |
I should have specified that the path to the project is not the normal path and would not be just one level up. How do I make sure |
Any idea is this is fixed in RN 0.73? I have tried 0.72.4, 0.72.6 and 0.72.8 and still the same issue.... If I remove the React-xxx workarounds from the Podfile I get back into #38283 |
@fdobre can you share your Podfile (please, wrap it into |
@cipolleschi Thank you for your answer. The error is:
if I comment next lines from post_install:
Then I run back into I am attempting to upgrade RN from 0.69.6 to 0.72.x. I've spent about 2 days with this issue. Any help or suggestion will be greatly appreciated. I am taking into consideration even advices to downgrades to RN 0.71.x or to upgrades to RN 0.73.x. |
Hum... your Podfile is definitely complicated and that would likely be the problem. As a rule of thumb, if a library is distributed on npm, it should not appear in the Podfile, but you should install it with In this way, autolinking will take care of adding the library to your app and it will configure it properly. Secondly, you are mixing static and dynamic frameworks with a cocoapods plugin. This is an unofficial configuration which is not a standard in iOS and we do not support it directly. I have evidence of people being successful with it, but it definitely make things more complicated. Looking at your Podfile, section by section: # Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
platform :ios, min_ios_version_supported
prepare_react_native_project!
flipper_config = FlipperConfiguration.disabled
-linkage = ENV['USE_FRAMEWORKS']
-if linkage != nil
- Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
- use_frameworks! :linkage => linkage.to_sym
-end
install! 'cocoapods', :deterministic_uuids => false
use_frameworks! :linkage => :static
inhibit_all_warnings!
$RNFirebaseAnalyticsWithoutAdIdSupport = true
source 'https://cdn.cocoapods.org/' you can remove this section because you are setting target 'WonderPushNotificationServiceExtension' do
platform :ios, '12.0'
pod 'WonderPushExtension', '~> 4.0'
end
# We need to switch StreamAMGSDK and its dependancy YouboraLib to a dynamic linking
# else we get duplicate symbols and can't compile the app
# however the React code requires / is set up with static linkage ^^ see use_frameworks
# therefore we are sorting the problem native pods and leaving them dynamic, rather than changing the entire project
$dynamic_library = ['StreamAMGSDK/PlayKit', 'YouboraLib']
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
bt = pod.send(:build_type)
if $dynamic_library.include?(pod.name)
puts "** #{pod.name} left as dynamic **"
else
puts "#{pod.name} static_library"
def pod.build_type;
Pod::BuildType.static_library
end
end
end
- end This last target 'MYAPP' do
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
permissions_path = '../node_modules/react-native-permissions/ios'
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
:flipper_configuration => FlipperConfiguration.disabled,
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
pod 'SwiftLint'
pod 'GoogleAds-IMA-iOS-SDK', '~> 3.18.1'
pod 'StreamAMGSDK/PlayKit', '1.3.0'
pod 'XCGLogger', :modular_headers => true
pod 'ObjcExceptionBridging', :modular_headers => true
- pod 'react-native-google-cast/NoBluetooth', path: '../node_modules/react-native-google-cast/'
- pod 'google-cast-sdk-no-bluetooth'
pod 'DailymotionPlayerSDK', '4.0.4'
- pod 'Didomi-XCFramework', '1.95.2'
- pod 'Permission-AppTrackingTransparency', :path => "#{permissions_path}/AppTrackingTransparency"
- pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
- pod 'Firebase', '~> 10.17.0', :modular_headers => true
- pod 'FirebaseCore', '~> 10.17.0', :modular_headers => true
- pod 'FirebaseCoreInternal', '~> 10.17.0', :modular_headers => true
- pod 'FirebaseCoreExtension', '~> 10.17.0', :modular_headers => true
- pod 'FirebaseInstallations', '~> 10.17.0', :modular_headers => true
- pod 'Firebase/Performance', '~> 10.17.0', :modular_headers => true
- pod 'Firebase/Crashlytics', '~> 10.17.0', :modular_headers => true
- pod 'Firebase/DynamicLinks', '~> 10.17.0', :modular_headers => true
- pod 'FirebaseABTesting', :modular_headers => true
- pod 'FirebaseRemoteConfig', :modular_headers => true
- pod 'GoogleDataTransport', :modular_headers => true
pod 'nanopb', :modular_headers => true
- pod 'GoogleUtilities', :modular_headers => true For For all the Firebase packages, use the React Native Firebase implementation as described here. This should also install the - def append_header_search_path(target, path)
- target.build_configurations.each do |config|
- # Note that there's a space character after `$(inherited)`.
- config.build_settings["HEADER_SEARCH_PATHS"] ||= "$(inherited) "
- config.build_settings["HEADER_SEARCH_PATHS"] << path
- end
- end
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["CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES"] = true
- config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
- config.build_settings["HEADER_SEARCH_PATHS"] ||= "$(inherited) "
- config.build_settings["HEADER_SEARCH_PATHS"] << "${PODS_ROOT}/../../node_modules/react-native/ReactCommon"
- if ["React-cxxreact", "React-NativeModulesApple", "React-runtimescheduler", "React-utils", "StreamAMGSDK/PlayKit"].any? { |t| t == target.name }
- end
- config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
- end
- end
end
end
Our cocoapods infra should take care of all these steps. -- Now, after these changes, your project might be quite dirty.
Let me know if this work. Your setup is complex and does not follow all the suggested practices, so it will be hard to fix it, but we can make it work. |
@cipolleschi I have applied the changes your recommended (except a few, I had to keep that Right now it's crashing inside the Didomi native code (I will have to replace that with Upgrading RN in my project from 0.69 to 0.72.x will be a huge effort. I will come back here immediately after I have a fully functional Podfile. Big thank you for all your suggestions! |
any info on that? 🙏 @wkwyatt @cipolleschi |
@andreimarkoff what's the question, exactly? This isssue is 7 month old, I'll need some more info to try and help you... 😅 |
@cipolleschi thank you for getting back to me and sorry for late reply. I am trying to use react native components in existing iOS app, but I am not adding my existing iOS app as a subfolder of react native project, and for that thats how I modified the podfile of an iOS project:
as you can see I dont have :path => config[:reactNativePath] |
Description
After upgrading my react native to version 0.72.0, I can't run my react native app on iOS properly as it logs an error saying: "Error 'ReactCommon/TurboModuleBinding.h' file" as show in the picture below.
I tried executing with the suggestions described here but unfortunately the error is still here.
Here is my Podfile:
React Native Version
0.72.0
Output of
npx react-native info
System:
OS: macOS 13.4
CPU: (8) arm64 Apple M1 Pro
Memory: 89.31 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.2.0
path: /usr/local/bin/node
Yarn: Not Found
npm:
version: 9.6.6
path: /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.12.1
path: /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 22.4
- iOS 16.4
- macOS 13.3
- tvOS 16.4
- watchOS 9.4
Android SDK:
API Levels:
- "28"
- "29"
- "30"
- "31"
- "32"
- "33"
Build Tools:
- 29.0.2
- 30.0.2
- 30.0.3
- 31.0.0
- 32.0.0
- 33.0.0
- 34.0.0
System Images:
- android-28 | Google APIs ARM 64 v8a
- android-28 | Google ARM64-V8a Play ARM 64 v8a
- android-29 | Google APIs ARM 64 v8a
- android-29 | Google Play ARM 64 v8a
- android-30 | Google APIs ARM 64 v8a
- android-31 | Google Play ARM 64 v8a
- android-32 | Google APIs ARM 64 v8a
- android-33 | Google APIs ARM 64 v8a
- android-33 | Google Play ARM 64 v8a
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.10121639
Xcode:
version: 14.3.1/14E300c
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.1
path: /usr/bin/javac
Ruby:
version: 3.2.2
path: /usr/local/opt/ruby/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.0
wanted: ^0.72.0
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: false
newArchEnabled: false
Steps to reproduce
arch -x86_64 pod install
(or tried withpod install
only)Snack, code example, screenshot, or link to a repository
The text was updated successfully, but these errors were encountered: