Proper way to use System environment variables in gradle using Android Studio

I also like having my keystore information on my environment variables, rather than having it inside the project. Your code seems fine, but I was having the same issue with the file path. I solved it by converting that value to string before passing it to file():

signingConfigs {
 debug {
    storeFile file(String.valueOf(System.getenv("KEYSTORE")))
    storePassword System.getenv("KEYSTORE_PASSWORD")
    keyAlias System.getenv("KEY_ALIAS")
    keyPassword System.getenv("KEY_PASSWORD")        
 }

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)