Can't run react native app from existing ios app
See original GitHub issueI tried to run my react native app using RCTRootView but keep throwing this error
2019-09-27 16:28:42.163 [info][tid:com.facebook.react.JavaScript] 'Failed to print error: ', 'Requiring module "node_modules/react-native/Libraries/Utilities/Platform.ios.js", which threw an exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): \'PlatformConstants\' could not be found. Verify that a module by this name is registered in the native binary.'
2019-09-27 16:28:42.171 [fatal][tid:main] Unhandled JS Exception: TurboModuleRegistry.getEnforcing(...): 'PlatformConstants' could not be found. Verify that a module by this name is registered in the native binary.
React Native version:
React 16.9.0 React-Native 0.61.1
pod config
pod 'React', :path => 'react/node_modules/react-native/'
pod 'React-Core', :path => 'react/node_modules/react-native/'
# pod 'React-DevSupport', :path => 'react/node_modules/react-native/React'
# pod 'React-fishhook', :path => 'react/node_modules/react-native/Libraries/fishhook'
pod 'React-RCTActionSheet', :path => 'react/node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => 'react/node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => 'react/node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => 'react/node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => 'react/node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => 'react/node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => 'react/node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => 'react/node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => 'react/node_modules/react-native/Libraries/Vibration'
# pod 'React-RCTWebSocket', :path => 'react/node_modules/react-native/Libraries/WebSocket'
pod 'React-cxxreact', :path => 'react/node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => 'react/node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => 'react/node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => 'react/node_modules/react-native/ReactCommon/jsinspector'
pod 'Yoga', :path => 'react/node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => 'react/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => 'react/node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => 'react/node_modules/react-native/third-party-podspecs/Folly.podspec'
Steps To Reproduce
- create react app
- configure xcode follow pod file
- http://$host:$port/index.bundle?platform=ios
Describe what you expected to happen:
run seemlessly
Snack, code example, screenshot, or link to a repository:
Running Code in XCode
NSURL *jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.67:19000/index.bundle?platform=ios"];
_rctBridge = [[RCTBridge alloc] initWithBundleURL:jsCodeLocation moduleProvider:nil launchOptions:nil];
_rootView = [[RCTRootView alloc] initWithBridge:_rctBridge moduleName:@"AppHome" initialProperties:@{@"appId":self.marketApp.appId}];
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:32
Top Results From Across the Web
Integration with Existing Apps - React Native
Integration with Existing Apps. React Native is great when you are starting a new mobile app from scratch. However, it also works well...
Read more >How to add React Native to an existing iOS app in 2022
I have been starting to use React Native in existing iOS and Android apps that I am maintaining. One of the problems I...
Read more >How to integrate react native code with an existing iOS app?
1. Create a directory structure and set up the dependencies. ... Create a root folder where the react native module and the existing...
Read more >Implement react-native-web on existing app, web can run but ...
So I want to implement react-native-web to an existing apps (Android and iOS) and I following this tutorial. And I run the web...
Read more >How to create React Native App for Android, iOS and Web ...
Step 1: Init a React Native Application: · Step 2: Run this new app in Android (optional) · Step 3: Web Setup.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I was able to fix this problem by adding the following podspecs:
I used this commit for guidance.
Getting same error and tried all above solution, but can’t success…
I’m using RN 0.61.2 with an existing iOS project.