Reputation: 178
I recently upgraded react-native to version 0.60. As a consequence, my Podfile looks like this:
target 'myProject' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for myProject
# this is very important to have!
rn_path = '../node_modules/react-native'
pod 'React', :path => '../node_modules/react-native'
pod 'React-Core', :path => '../node_modules/react-native/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
...
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
One of the project dependencies is FBSDK, as it is shown above. The problem is that this dependency relies on React pod instead of React-Core, so the build fails because some modules are not found using the path React/Module:
Xcode, File RCTFBSDKMessageDialog.h (from the pod react-native-fbsdk):
#import <React/RCTBridgeModule.h>
#import <FBSDKShareKit/FBSDKShareKit.h>
@interface RCTFBSDKMessageDialog : NSObject <RCTBridgeModule>
@end
I get the error: error 'React/RCTBridgeModule.h' file not found
If I change it for React-Core/React/RCTBridgeModule.h it works.
Any idea to make it work without renaming all the references?
Upvotes: 3
Views: 3070
Reputation: 178
I solved it finally.
The problem was on the Podfile, the last part was removing React from the ios project target(I had this for the previous React version):
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
end
end
And I had to add this lines as well (from React Native Upgrade helper):
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
...
use_native_modules!
So, in conclusion, the problem was that after upgrading to 0.60, the Podfile was not correctly upgraded so React module was not added to the iOS target.
Upvotes: 1