Replies: 1 comment
-
Mode release will default to development unless you overwrite with APP_ENV |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello.
I have created a couple of .env files in my project:
.env.development
.env.production
I have set two different values for the API_BASE_URL since I need to connect to the backend according to the environment.
I currently these scripts in my package.json:
My problem is that when I create a release APK using the apk-dev script, it is generated using the .env.production file. I've even used this script
"apk-dev": "NODE_ENV=development ENVFILE=.env.development react-native run-android --mode=release"
but it still uses the .env.production file.Adding more details: both
.env.production
and.env.development
files have a variable calledDEV
, which has value"true"
or"false"
depending on the case. Additionally, I have this line of code in my build.gradle file:println 'THIS IS THE DEV VALUE: ' + project.env.get("DEV")
, and during APK generation it prints"true"
, which means, during compilation it does use the .env.development file, but the final APK uses .env.production, which is the original problem.Beta Was this translation helpful? Give feedback.
All reactions