[英]How to change gradlew .env file?
I have a react native project.我有一个反应原生项目。
I want to build a release to publish on play store, here in react native official documentation to publish an app we can see:我想构建一个发布到 Play 商店的版本,这里在 react native 官方文档中发布一个我们可以看到的应用程序:
Generating the release AAB
生成发布 AAB
Run the following in a terminal:
在终端中运行以下命令:
cd android./gradlew bundleRelease
Here is the first outputs I got:这是我得到的第一个输出:
./gradlew bundleRelease
Starting a Gradle Daemon (subsequent builds will be faster)
> Configure project :app
Reading env from: .env
gradlew
is reading my env vars in .env
file while I got a .env.production
that I want gradlew
to read instead. gradlew
正在读取.env
文件中的 env vars,而我有一个.env.production
,我希望gradlew
改为读取。
How can I do this?我怎样才能做到这一点?
I would recommend you to use react-native-config if you want to use other type of.env files for different environments.如果您想在不同的环境中使用其他类型的 .env 文件,我建议您使用react-native-config 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.