react-native: [iOS - RN 0.61.1 migration] Cannot release or run on real device because of the missing of React target in scheme
React Native version:
System: OS: macOS 10.14.6 CPU: (4) x64 Intel® Core™ i5-4278U CPU @ 2.60GHz Memory: 1.62 GB / 16.00 GB Shell: 5.3 - /bin/zsh Binaries: Node: 10.15.1 - ~/.nvm/versions/node/v10.15.1/bin/node Yarn: 1.13.0 - /usr/local/bin/yarn npm: 6.4.1 - ~/.nvm/versions/node/v10.15.1/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3 Android SDK: API Levels: 23, 27, 28 Build Tools: 27.0.3, 28.0.2, 28.0.3 System Images: android-27 | Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom IDEs: Android Studio: 3.2 AI-181.5540.7.32.5056338 Xcode: 10.3/10G8 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.1 => 0.61.1
Steps To Reproduce
- I migrate my project from 0.60.5 to 0.61.1 using upgrade-helper-tool
- Go to xcode --> Product Menu --> Scheme --> Edit Scheme --> In the build section we will see the Target
React (missing)
- Try to press the ‘+’ icon and find React but cannot find it
- Try to run the project on a real device or release it, then several dependencies will report errors such as:
- ‘React/UIView+React.h’ file not found
- ‘React/RCTBridgemodule.h’ file not found
Describe what you expected to happen:
It should run the project or release it normally just like the 0.60.5 version
Snack, code example, screenshot, or link to a repository:
This is my podfile:
`platform :ios, ‘9.0’ require_relative ‘…/node_modules/@react-native-community/cli-platform-ios/native_modules’
def shared_pods pod ‘FBLazyVector’, :path => “…/node_modules/react-native/Libraries/FBLazyVector” pod ‘FBReactNativeSpec’, :path => “…/node_modules/react-native/Libraries/FBReactNativeSpec” pod ‘RCTRequired’, :path => “…/node_modules/react-native/Libraries/RCTRequired” pod ‘RCTTypeSafety’, :path => “…/node_modules/react-native/Libraries/TypeSafety” pod ‘ReactCommon/jscallinvoker’, :path => “…/node_modules/react-native/ReactCommon” pod ‘ReactCommon/turbomodule/core’, :path => “…/node_modules/react-native/ReactCommon” pod ‘Yoga’, :path => ‘…/node_modules/react-native/ReactCommon/yoga’ pod ‘React’, :path => ‘…/node_modules/react-native/’ pod ‘React-Core’, :path => ‘…/node_modules/react-native/’ pod ‘React-CoreModules’, :path => ‘…/node_modules/react-native/React/CoreModules’ pod ‘React-Core/DevSupport’, :path => ‘…/node_modules/react-native/’ pod ‘React-RCTActionSheet’, :path => ‘…/node_modules/react-native/Libraries/ActionSheetIOS’ pod ‘React-RCTAnimation’, :path => ‘…/node_modules/react-native/Libraries/NativeAnimation’ pod ‘React-RCTBlob’, :path => ‘…/node_modules/react-native/Libraries/Blob’ pod ‘React-RCTImage’, :path => ‘…/node_modules/react-native/Libraries/Image’ pod ‘React-RCTLinking’, :path => ‘…/node_modules/react-native/Libraries/LinkingIOS’ pod ‘React-RCTNetwork’, :path => ‘…/node_modules/react-native/Libraries/Network’ pod ‘React-RCTSettings’, :path => ‘…/node_modules/react-native/Libraries/Settings’ pod ‘React-RCTText’, :path => ‘…/node_modules/react-native/Libraries/Text’ pod ‘React-RCTVibration’, :path => ‘…/node_modules/react-native/Libraries/Vibration’ pod ‘React-Core/RCTWebSocket’, :path => ‘…/node_modules/react-native/’ pod ‘React-cxxreact’, :path => ‘…/node_modules/react-native/ReactCommon/cxxreact’ pod ‘React-jsi’, :path => ‘…/node_modules/react-native/ReactCommon/jsi’ pod ‘React-jsiexecutor’, :path => ‘…/node_modules/react-native/ReactCommon/jsiexecutor’ pod ‘React-jsinspector’, :path => ‘…/node_modules/react-native/ReactCommon/jsinspector’ 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’ pod ‘Firebase/Core’, ‘~> 5.20.1’ pod ‘RNFirebase’, path: ‘…/node_modules/react-native-firebase/ios’ pod ‘FBSDKCoreKit’, ‘~> 5.3.0’ pod ‘FBSDKLoginKit’, ‘~> 5.3.0’ pod ‘FBSDKShareKit’, ‘~> 5.3.0’ pod ‘Mixpanel’ pod ‘google-cast-sdk’, ‘~> 3’ pod ‘react-native-google-cast’, path: ‘…/node_modules/react-native-google-cast/ios/’ pod ‘react-native-keep-awake’, :path => ‘…/node_modules/react-native-keep-awake’ pod ‘lottie-ios’, :path => ‘…/node_modules/lottie-ios’ pod ‘lottie-react-native’, :path => ‘…/node_modules/lottie-react-native’ pod ‘RNShare’, :path => ‘…/node_modules/react-native-share’ end
target ‘MyApp’ do shared_pods target ‘MyAppDev’ do inherit! :search_paths # Pods for testing end use_native_modules! end
post_install do |installer| installer.pods_project.targets.each do |target| if target.name == “React” target.remove_from_project end end end `
- I already tried to remove the snippet: post_install do |installer| installer.pods_project.targets.each do |target| if target.name == “React” target.remove_from_project end end end
Then reinstalled pods, then when I press + icon in Scheme Edit window, I can now find the React Target, but this target icon is different from the icon that I used to see before, and I also tried to run again but it not working also, you guys can see in the screenshot below:
Before: The React icon is just like a bank icon
After: The new version makes it look like a bull’s eye
- I have tried to init a new react-native project, and the React target is also missing, but I can run that project because it’s fresh and has no dependencies.
Any idea why this problem happens guys?, Thank you guys so much!
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 18
- Comments: 16 (1 by maintainers)
Hello, I don’t recommend we close this issue, it’s still a bug, we’re requiring Cocoa pods now, which should have been mentioned as a breaking change but wasn’t
@kennym I just followed exactly what you said, and awesome, now everything is working fine on iOS. Thanks a lot!!! 😍😍
react-native-orientation
and cannot find the Cocoapods instruction because it’s inactive, I recommend you to migrate to react-native-orientation-locker which is using the same APIs but with Cocoapods instructionI already set xcode settings to legacy build system 😭
@nenjamin2405 look at other projects which use Cocoapods… I copied the Podfile of other projects, put them into the projects that I was having trouble with, removed all statically linked references in Xcode, added dependency to Podfile, and things started working.
It’s okay when I rollback to RN 0.60.5, but I really want to use Fast Refresh and new stuffs. It’s working on Android, the remaining problem is this problem
I got the issue too 😦 Any workaround? I’ve tried to upgrade RN from 0.60.5 to 0.61.1 but when I rollback to 0.60.5 the error appears again.