When building an android release, I use the command cd android && ENVFILE=.env.production ./gradlew assembleRelease. When i open the app however, all of my config settings are from the .env file. This has essentially broken my entire build process. please help
Same here. I've noticed that when installing the app for the first time, the env vars are taken correctly
update this seems to be related to JDK 11, downgrading to 8 fixed the issue
i had the same issue and fixed by running gradlew clean
I don't think this should be closed, it's still an issue.
i had the same issue
@zhangjunhou that's not the problem, i had that there and still had the issue
Same problem here.
My java version :
java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
I can confirm that downgrading from Java 10 to 8 fixed this problem
I created bash script (placed in _./scripts/installDebug.sh_ ) that replaced .env file with .env.development file:
cp -fr .env.development .env
cd android
./gradlew installDebug
cd ..
now I run ./scripts/installDebug.sh instead react-native run-android
Same here.
Sama here
Same here. Docs are wrong. ENVFILE arg doesn't work when building like OP wrote. I did something similar to @vladbars, but it's only necessary when compiling - my react-native run worked