React-native-config: Android is reading from the wrong env file

Created on 10 Nov 2018  路  13Comments  路  Source: luggit/react-native-config

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

All 13 comments

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:

!/usr/bin/env bash

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jemise111 picture jemise111  路  4Comments

timscott picture timscott  路  5Comments

kidnapkin picture kidnapkin  路  3Comments

aajkishore picture aajkishore  路  3Comments

swl367 picture swl367  路  4Comments