Open 22mSqRi opened 1 year ago
You can try ./gradlew assembleAaaRelease
The file that determines the .env
to use can be seen at https://github.com/luggit/react-native-config/blob/master/android/dotenv.gradle
. If you can't get it to work you can edit node_modules/react-native-config/android/dotenv.gradle
and add println
to debug the variables.
That said by right your project.ext.envConfigFiles
should looks something like
project.ext.envConfigFiles = [
aaadebug: ".env.aaa",
aaarelease: ".env.aaa",
bbbdebug: ".env.bbb",
bbbrelease: ".env.bbb"
]
If you're using any other name than the default (plain old ".env"), then you need to specify this:
// ADD THIS
project.ext.defaultEnvFile = "path/to/.env.file"
// above this
project.ext.envConfigFiles = [
...
Otherwise the library will keep looking for ".env" when it's been renamed to ".env.otherwise"
Maybe add this to the docs, whoever supports this library.
@BoilingOil
project.ext.defaultEnvFile = "path/to/.env.file"
This doesn't do anything.
I use this in my project currently. Maybe the path to your .envfile needs correction.
Try this. Maybe there is permission issue. https://github.com/luggit/react-native-config/issues/541#issuecomment-1491388207
@BoilingOil, Yeah, setting Default env solves the issue. But it's not be useful for using with CICD when want to release build in single commit.
Hi, everyone. I want to each
.env
file with product flavor. But when I use./gradlew assemblerelease
, builder showMissing .env file
message and no setting environment information.build.gradle
When I use Build Variants command on Android Studio and
run-android
command, environment information is setting correct.How should I do setting environment information when assemblerelease?