Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded to RM 0.73 - Metro bundler not connected to app when running in iOS Simulator #264

Closed
plindsay opened this issue Mar 22, 2024 · 1 comment

Comments

@plindsay
Copy link

plindsay commented Mar 22, 2024

Environment

System:
OS: macOS 14.4
CPU: (10) arm64 Apple M2 Pro
Memory: 86.38 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.6.1
path: ~/.nvm/versions/node/v20.6.1/bin/node
Yarn:
version: 1.22.19
path: /opt/homebrew/bin/yarn
npm:
version: 9.8.1
path: ~/.nvm/versions/node/v20.6.1/bin/npm
Watchman:
version: 2024.03.18.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.12.1
path: /Users/phil/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.4
- iOS 17.4
- macOS 14.4
- tvOS 17.4
- visionOS 1.1
- watchOS 10.4
Android SDK: Not Found
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.10671973
Xcode:
version: 15.3/15E204a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.10
path: /usr/bin/javac
Ruby:
version: 2.7.6
path: /Users/phil/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.6
wanted: 0.73.6
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false

Things I’ve done to figure out my issue

Upgrading version

From 0.71.17 to 0.73.6

Description

I can successfully create an iOS build (using npx react-native run-ios) however the Metro bundler doesn't seem to connect to the app or create the bundle. Before the upgrade I would start Metro in one terminal window via yarn start and then npx react-native run-ios in another terminal window. This would work great and Metro would 'watch' changes and reload the app in the Simulator.

Now, after the upgrade, the connection with the iOS app seems to be no longer there, i.e. the bundle is not created and it doesn't 'watch' any changes to the code.

If I hit 'r' in the Metro window it says

'No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.'

Everything works fine when I test on Android though using the same workflow - e.g. yarn start in one terminal windown, and npx react-native run-android in another terminal window.

It seems somehow this part of the iOS build has been removed. I'm a bit stuck on why this has happened and how to resolve it.

Reproducible demo

Run yarn startin one terminal window and thennpx react-native run-ios` in another terminal window, and check that Metro creates the bundle and watches for changes.

@plindsay
Copy link
Author

I found the problem - https://stackoverflow.com/a/64895016/134823

Not sure why this changed, but changing the scheme in Xcode to Debug connected the app to Metro 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant