Closed Aashu-Dubey closed 1 year ago
Hey @Aashu-Dubey, you're using the 9.2.1
version of cli
, but react-native-macos
is using the 7.0.3
, and between these two version some things changed and this causes error. So to make that working you must use older react-native
version 😄
Environment
Description
I have encountered conflict between ios and macos platform module if used together while running the
npx react-native run-ios
command, whererun-ios
fails to find the workspace file under ios folder after adding macos support using this guide.Initially when creating a new project or if you're only using default added platforms, it works just fine. but as soon as I add
react-native-macos
, cli throws this error:Reproducible Demo
To reproduce,
npx react-native init AwesomeProject
as specified here (I used the one for typescript template).run-ios
command and it'll work fine.npx react-native-macos-init
as specified here.run-ios
and you'll get above error, while therun-macos
works just fine.Now to check what is causing this issue or whether it is from this cli or from macos one, I did a little debugging, and the error is thrown here, so I added a logger here (in node_modules code) to check the data before and after adding the macos support.
Here's the line for logger to be precise:
Before or for new initial project:
Here we get these two fields, which seems to be the one expected.
Now after adding macos support using command
npx react-native-macos-init
as specified here, first when runningrun-ios
cli throws above mentioned error.And this is the data printed by the logger:
Now we get the same value for
sourceDir
, and some extra data that wasn't printed earlier, but now we're missingxcodeProject
, which is what is throwing the above error.This is all that I checked, so I'm not sure why it is happening. While it seems the cli is getting correct ios path and other details are also ios specific only.
Maybe cause both ios and macos module create the workspace files with same name?
Also I wasn't sure where to report this issue, here or at react-native-macos, but based on above debugging, it seems the issue is here, still let me know if I should report it there.
Based on
node_modules/@react-native-community/cli-platform-ios/package.json
, the cli version used is9.2.1
.Thank you!