Closed brunolemos closed 5 years ago
It seems like common flags declared in cliEntry
, are not passed properly to commands. This applies to run-android
and run-ios
. I'll investigate that.
EDIT. Not entirely sure, but it seems like this functionality is broken for a while now.
@brunolemos it seems like there is a mismatch between parameters that set root
in run-android
and run-ios
. I was able to make things work in your project by running:
react-native run-android --root packages/mobile
This seems very wrong and counter-intuitive to have different flags between commands. This might work as a temporary solution in your project, but we definitely need to fix that one.
This is not a bug with projectRoot
per se. projectRoot
describes the root of the CLI - the folder we should look for node_modules from. It defaults to cwd
.
The root
inside run-android
is equivalent of projectPath
inside run-ios
. It's to explicitly set the location of the android
folder.
Setting projectRoot
to packages/mobile/android
is not good since this is not really the root of your app.
We should rename root
to something more intuitive, e.g. androidAppFolder
. I have an open issue to update this command tho to automatically detect android
folder location. See issue #143 for details.
Yes ideally the cli option should have the same name for both ios and android, don't know if there's any issue tracking this.
I guess #143 is a good one. I'll make sure to rename it, tho I am planning to make a detection system automatically detect unusual locations.
Environment
I have the latest
@react-native-community/cli
2.x installed globally andreact-native
0.59 in the project.Description
Cannot run
react-native run-android ...
from the monorepo root.For iOS it works:
react-native run-ios --project-path packages/mobile/ios
Reproducible Demo
react-native run-android --projectRoot packages/mobile/android
Project: https://github.com/brunolemos/react-native-web-monorepo