Android Studio Does Not Honor Environment Variables
Solution 1:
I have done investigation based on the comments by @DeeV and @CommonsWare and have done some changes to run the build successfully on Android Studio as well as on command line.
I have placed gradle.properties file in Gradle's home directory. In my environment (ubuntu) the gradle home directory is located at
~/.gradle
.I have to remove the
System.env.
from the usage of the variables, so this way it uses the properties declared in gradle.properties file.
With these two changes, I noticed that the Android Studio problem got resolved. However this has caused another problem, the CL build was failing with error:
Failed to read key relase_key from store "/home/ubuntu/ks/myapp/app-release.keystore": Keystore was tampered with, or password was incorrect.
This means the gradle when run from CL can resolve the path but fails to read key from KS.
I have to do the following step to get rid of this error:
- In the gradle.properties, I had put the values for
RELEASE_KEY_PASSWORD
andRELEASE_KEY_STORE_PASSWORD
in double quotes, I removed the quotes and then the build completed successfully from command line.
I hope this will help anyone who face similar situation.
Post a Comment for "Android Studio Does Not Honor Environment Variables"