Common Setup Errors - uoftblueprint/the-period-purse-ios GitHub Wiki
- When trying to run project using
npm run ios
, I see "Error: EMFILE: too many open files"
- Ensure you have
brew
installed and runbrew install watchmen
- Source: https://stackoverflow.com/questions/58675179/error-emfile-too-many-open-files-react-native-cli
- When trying to run project using
npm run ios
, I see "error: unable to find utility 'simctl', not a developer tool or in PATH"
- Go to
Xcode > Preferences > Locations
and assign the Command Line tools. - Source: https://stackoverflow.com/questions/29108172/how-do-i-fix-the-xcrun-unable-to-find-simctl-error
- Ran
npm run ios
, and you get 'error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65'.
- If you don't have
cocoapods
installed, install it withsudo gem install cocoapods
. Then follow these steps:- run
cd ios
- run
pod install
- run
cd ..
- delete build folder
- run
npm run ios
- run
- Source: https://stackoverflow.com/questions/55235825/error-failed-to-build-ios-project-we-ran-xcodebuild-command-but-it-exited-wit
- When I try to open the app on the simulator I see "Invariant Violation: requireNativeComponent: "RNCSafeAreaProvider" was not found in the UIManager"
-
Stop running the app. Close the simulator, terminate the running instance.
-
Run command
npx pod-install ios
-
Restart app with
npm run ios
-
Manually link
RNCSafeAreaProvider
- If it's still not working, double check the output from
npx pod-install ios
. Specifically look for this line: "Auto-linking React Native modules for target `tppapp`: RNGestureHandler, RNReanimated, and RNScreens". - If RNCSafeAreaProvider is not included in that list, it means that we will have to manually link it. In your Podfile in
/ios
, add the following line to Line 12, underuse_react_native!
:pod 'react-native-safe-area-context', :path => '../node_modules/react-native-safe-area-context'
- Reinstall your pods with
npx pod-install ios
from thetpp-app
directory. - Restart the app with
npm run ios
. The error should be gone. - Source: https://github.com/th3rdwave/react-native-safe-area-context#linking-in-react-native--060-1
- If it's still not working, double check the output from
- When I try to open the app on the simulator I see: “Invariant Violation: “main” has not been registered”
- Delete "react-native-gesture-handler" from package.json
- Go into node_modules folder and delete the react-native-gesture-handler folder manually
- Run command
npm install react-native gesture-handler
and thenexpo install react-native-safe-area-context
- Rebuild node_modules folder using
yarn install
- Finally, re-install pods with command
npx pod-install ios
- Source: https://stackoverflow.com/questions/62649381/invariant-violation-main-has-not-been-registered
- I see error "CocoaPodsError: Command
pod install
failed. Cause: pod exited with non-zero code: 1"
- reinstall package managers in Rosetta 2
- Run command
npm audit fix
- replace contents of index.json with
import 'react-native-gesture-handler';
import { registerRootComponent } from 'expo';
import { AppRegistry } from 'react-native';
import App from './App';
AppRegistry.registerComponent('main', () => App);
- When I try to run the app, I see "error Failed to launch the app on simulator, An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=405): Unable to lookup in current state: Shutdown."
- Make sure the simulator is closed, then run
npm run ios
again - If that doesn't work, run
npx react-native run-ios --simulator="iPhone 8"
, or any other model besides the one you just tried to simulate - Source: https://stackoverflow.com/questions/69312343/build-error-domain-com-apple-coresimulator-simerror-code-405
- You run
npm run ios
, and the simulator doesn't launch. See error below
- Increase RAM allocated to the VM, or change which model you are simulating to on that requires less RAM