I have just upgraded from Xcode 11 to Xcode 12 (on MacOS Catalina).
The following are several things that I have done after the upgrade and I am seeking advice for two things:
When I open myproject.xcodeproj in Xcode, main.jsbundle is marked red (not available), I am not sure why (something wrong with the upgrade to Xcode 12?).
You can see the screenshot in https://stackoverflow.com/questions/64523206/problems-building-a-new-react-native-project-in-xcode
Anyway, the project is running on a simulator.
Then, I want to use cocapods, so I close the project, delete derivedData, and run pod init and pod install. Then I open myproject.xcworkspace in Xcode, and this is what I see:
You can see the screenshot in https://stackoverflow.com/questions/64523206/problems-building-a-new-react-native-project-in-xcode
I assume that this is not what should be displayed. The project is still running on the simulator, I am just curious to know if I am doing anything wrong.
Now, I modify the Podfile to the contents shown below.
I open the project again in Xcode and delete from 'frameworks, libraries and emebedded content' all the libraries so that only the JavaScriptCore.framework and Pods_myproject.framework are left (which may be a problem, since the later is marked in red in the project tree).
Now the build fails with the error ld: framework not found React.
So, wrong Xcode installation, my mistakes? Both?
Here is the Podfile after my modifications:
The following are several things that I have done after the upgrade and I am seeking advice for two things:
Do some of the problems I am facing indicate possible problems in the Xcode installation? Should I uninstall Xcode and install again?
or, am I doing anything wrong?
Code Block react-native init --version="react-native@0.59.9" myproject
When I open myproject.xcodeproj in Xcode, main.jsbundle is marked red (not available), I am not sure why (something wrong with the upgrade to Xcode 12?).
You can see the screenshot in https://stackoverflow.com/questions/64523206/problems-building-a-new-react-native-project-in-xcode
Anyway, the project is running on a simulator.
Then, I want to use cocapods, so I close the project, delete derivedData, and run pod init and pod install. Then I open myproject.xcworkspace in Xcode, and this is what I see:
You can see the screenshot in https://stackoverflow.com/questions/64523206/problems-building-a-new-react-native-project-in-xcode
I assume that this is not what should be displayed. The project is still running on the simulator, I am just curious to know if I am doing anything wrong.
Now, I modify the Podfile to the contents shown below.
I open the project again in Xcode and delete from 'frameworks, libraries and emebedded content' all the libraries so that only the JavaScriptCore.framework and Pods_myproject.framework are left (which may be a problem, since the later is marked in red in the project tree).
Now the build fails with the error ld: framework not found React.
So, wrong Xcode installation, my mistakes? Both?
Here is the Podfile after my modifications:
Code Block platform :ios, '11.0' target 'myproject' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! # Pods for myproject rn_path = '../node_modules/react-native' pod 'React', path: rn_path, subspecs: [ 'CxxBridge', 'RCTText', 'RCTNetwork', 'RCTWebSocket', 'RCTAnimation', 'RCTActionSheet', 'RCTGeolocation', 'RCTImage', 'RCTSettings', 'RCTVibration', 'RCTLinkingIOS' ] pod 'yoga', :path => "#{rn_path}/ReactCommon/yoga" pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' target 'myprojectTests' do inherit! :search_paths # Pods for testing end post_install do |installer| installer.pods_project.targets.each do |target| if target.name == "React" target.remove_from_project end end end end