8

I want to store my key store in my Android studio Project so that I can use a relative path in the Generate Signed APK Wizard. But I cant see to figure out where the Signed APK Wizard is looking.

How can I use a relative path to my android studio project to my keystore for use with the Generate Signed APK Wizard?

Mr. MonoChrome
  • 1,383
  • 3
  • 17
  • 39
  • 1
    Look at different options here http://stackoverflow.com/q/18328730/2504101. My understanding is that if you want to use relative path to keystore you have to put keystore file under the same directory as gradle build file. Or to specify path like this "./../../path/to/myKey.keystore". What is the reason not to use absolute path? Are using different keystores for different projects? – olyv Apr 15 '15 at 15:07

1 Answers1

9

I just tried in Android Studio 1.4 and it seems that the wizard uses paths relative to the project directory.

Example:

  • project directory /home/dev/project
  • module name app
  • keystore file /home/dev/project/app/keystores/debug.keystore

In the wizard following works for me app/keystores/debug.keystore (notice that path is relative - without leading slash).

Adding following to the build.gradle in module will use relative path to the debug.keystore as well (notice that the module name is not listed there as we are already inside the app module)

android {
    signingConfigs {
        debug {
            keyAlias 'androiddebugkey'
            keyPassword 'android'
            storeFile file('keystore/debug.keystore')
            storePassword 'android'
        }
    }
...
}
Tono Wiedermann
  • 608
  • 6
  • 13