KEMBAR78
always set default value instead of .env by tkow · Pull Request #373 · lugg/react-native-config · GitHub
Skip to content

Conversation

@tkow
Copy link
Contributor

@tkow tkow commented Aug 1, 2019

Closes #327

This is one solution using defalutEnvFile to avoid mismatching env setting by not included build variant string if the other task about build task calling dotenv.gradle. check #327.

@humarkx
Copy link

humarkx commented Aug 21, 2019

@tkow

I have a problem with this, but dunno if its related.

So in my case, .env.staging and .env.production works, but whenever I try to use .env or .env.development I can't read from it

@tkow
Copy link
Contributor Author

tkow commented Aug 30, 2019

@mushinz

Your problem maybe envConfigFiles key mismatch build variant as I see #381.
Follow up https://developer.android.com/studio/build/build-variants.
You need to set envConfigFilesKey is your buildType + flavor(if you don't use , just match buildType) So, you should set debug instead development key.

This key is assembled to gradle task name and this library use this naming rule to detect which your build environment used. Thus, gradle task throw error when task name doesn't depend on build variant. This PR avoid to do when you set some env path as default.

@luancurti luancurti self-requested a review March 19, 2020 01:13
@luancurti luancurti merged commit da7aef3 into lugg:master Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing .env file in Android Studio

3 participants