Skip to content
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

always set default value instead of .env #373

Merged
merged 1 commit into from Mar 19, 2020

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