0

I want to sign the release build of my app in build.gradle as shown below:

release {
    storeFile file(System.getenv("DEMO_PATH").toString())
    storePassword System.getenv('DEMO_PASSWORD').toString()
    keyAlias System.getenv("DEMO_ALIAS").toString()
    keyPassword System.getenv("DEMO_PASSWORD").toString()
}

but it is working when I am using Github actions(after necessary adjustments) and not when trying to run the release mode of the app locally in android studio as the values are null inside Gradle when building locally(checked using printing). I have defined environment variables in my ~/.bashrc and echo ${DEMO_PATH} returns correct path. I am using Ubuntu 21.04. How can I build the release track of my app both in Github actions and locally using Android Studio without exposing Keystore values in build.gradle?

I have tried this answer but it is not working.

Kartik Watwani
  • 619
  • 8
  • 19
  • 1
    Android Studio has no access to those environment variables. You could run your Gradle task from the command line. – CommonsWare Sep 08 '21 at 18:12

0 Answers0