I am having a KEY_STRING as system variable in mac OSX and Windows. Which has absolute path to my keystore.
~/.bash_profile entry would be
export KEY_STRING =~/config/release-signing.keystore
Same path setup in each of my team mates machines[Windows/OSX/Linux].
My Gradle script to access this variable would be
def keystorePath = System.getenv("KEY_STRING");
println keystorePath;
This script works fine in Windows in both console and android studio.
My problem specific to mac android studio.
If I run the build in terminal which is working fine and reads the env variable.
But when I do gradle sync or set up run configuration [Gradle task] it cannot resolve the variable.
I have reported this issue to Google as well.
Again here is the quick summary: