I'm trying to build APK from command line in my React Native
project. I've used react-native-config plugin to define my API URLs based on selected environment.
When I try to launch the app on emulator with the command (from Terminal
), ENVFILE=.env.dev react-native run-android
, app builds and launches properly.
But when I try to generate Release build using the command (from Terminal
), ENVFILE=.env.dev && cd android && ./gradlew clean build
, command fails with the log:
> Configure project :app
Reading env from: .env
**************************
*** Missing .env file ****
**************************
Question: How to build Release APK using ENVFILE from Terminal?