-
Notifications
You must be signed in to change notification settings - Fork 891
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
How do you set mode with 'react-native start'? #2359
Comments
hey @jpetersen23 if you want to specify module.exports = {
project: {
android: {
watchModeCommandParams: ['--mode', 'whateverYouWant'],
},
},
} |
Thanks @szymonrybczak that worked to get me passed the build error! For future people who may look at my specific patch, the body of my
|
Turns out I spoke too soon, I seem to have broken live reloading of tsx changes. Additionally when I hit r in watch mode (yarn start) I see:
And nothing updates. I confirmed the same is true if I run the commands directly as
I also confirmed its not a debug mode thing by trying
And that also doesnt cause it to live update again (or reload with R in the console or in the app itself). UPDATE: I needed to add things to the debuggable variants list.
|
I'm trying to get Android flavors to work with the latest react-native and I can get it correctly reading mode when I run
react-native run-android --mode=productionrelease
But for the life of me, I cant figure out how to set the mode for
react-native start
as a result, when I try to open android I get an error:
Cannot locate tasks that match 'app:installDebug' as task 'installDebug' is ambiguous in project ':app'. Candidates are: 'installDevelopmentDebug', 'installDevelopmentDebugAndroidTest', 'installProductionDebug', 'installProductionDebugAndroidTest', 'installStagingDebug', 'installStagingDebugAndroidTest'.
I think its because gradle cant correctly figure out what mode I want it to run in, but reading the documentation, I cant find a way to make it work.
Older stackoverflow options had suggested hacking the cli to force it to use a custom install command, but I cant find in the CLI where that is even happening now.
https://stackoverflow.com/a/50704977
I've also found older versions of react-native that seem to have handled sending down variant, but that seems to have broken when it was switched to mode?
Here is a working example relying on variant: https://github.com/sdavid501/multiplatform
I believe I've also confirmed its not a problem with https://github.com/lugg/react-native-config by not integrating it and just doing the work of adding flavors breaks the command.
I've also made a very simple version running the following commands:
npx react-native@latest init ReactNativeConfigTestAppLatest
and then applying this patch to react flavors:
added_flavors.patch
Anyway I'm not sure where to take it at this point beyond figuring out how to hack the tool, which I'm hoping to avoid.
Thanks.
The text was updated successfully, but these errors were encountered: