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
Setting the right environment for development and release builds #209
Comments
Hey, thank you for opening this issue! 🙂 To boost priority on this issue and support open source please tip the team at https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/209 |
In my experience, it works better to set the environment variable on the same line as your server. What operating system are you on? |
Thanks for your reply. Its run in App center VMs which are macOS for react native. |
Try > NODE_ENV=production react-native start --reset-cache Instead of > NODE_ENV=production
> react-native start --reset-cache |
It works like that if I try locally. But the issue is that on a remote VM the metro bundler starts automatically before build so I wont have much control over what passed in the command |
okay I understand now. this is a common issue. You'll need to check out custom signing of your app as well as using variant / configuration / bundle options addressed in the wiki https://github.com/goatandsheep/react-native-dotenv/wiki/Multi-env-troubleshooting#react-native-cli Let me know if this works |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Could you give me an example on how to do it? I was thinking in setup different values for NODE_ENV based on which buildType I'm assembling, but I don't know very much about gradle and everything I tried until now failed 😔 |
I am trying to use
.env.development
and.env.production
based off of NODE_ENV. We use App center to generate release builds. The environment always defaults to.env.development
when I set NODE_ENV to production.Steps I do is as follows:
The text was updated successfully, but these errors were encountered: