question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[iOS - RN 0.61.1 migration] Cannot release or run on real device because of the missing of React target in scheme

See original GitHub issue

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

  1. I migrate my project from 0.60.5 to 0.61.1 using upgrade-helper-tool
  2. Go to xcode --> Product Menu --> Scheme --> Edit Scheme --> In the build section we will see the Target React (missing)
  3. Try to press the ‘+’ icon and find React but cannot find it
  4. 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 image

After: The new version makes it look like a bull’s eye image

- 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!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:18
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
alnorriscommented, Oct 1, 2019

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

3reactions
nathantqncommented, Oct 1, 2019

@kennym I just followed exactly what you said, and awesome, now everything is working fine on iOS. Thanks a lot!!! 😍😍

  • For those who are facing this problem because of using RN 0.61.1, please make sure to remove all statically linked references in Xcode for old libs, then re-install all libraries using Cocoapods. If you are using 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 instruction
Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native 0.64 won't build iOS app after updating Xcode to ...
React native 0.64.1 has been released and will solve this. Just update the version number in package.json ...
Read more >
Installation | React Native Navigation - Open Source
Once this is done, you can click back to the menu in Xcode: `Product -> Scheme -> Manage Schemes`, then click '+' to...
Read more >
Publishing to Apple App Store - React Native
The publishing process is the same as any other native iOS app, with some additional considerations to take into account.
Read more >
Integrating React Native with existing Android and iOS native ...
Integrate a basic RN project (using redux pattern, navigating between multiple screens, fetch api…) to simple existing Android and iOS projects. Call native ......
Read more >
React Native 0.62 and Flipper Will Change Your Mobile ...
You could debug Javascript using the remote debugging which is done through the browser debugger. It means that instead of running the code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found