Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting A Relative Path for a Keystore File

Tags:

java

android

I am working on a project and submitted for review by one of my peers. In their previous review, he stated that my keystore file needed to be saved in a relative path. I am submitting via GitHub. Currently, my keystore file is saved in the root directory of my project. Also, in my build.gradle, I have the following:

signingConfigs {
    config {
        keyAlias 'Udacity'
        keyPassword 'xxxxxxxx'
        storeFile file('/Users/user/Applications/LiveVotingUdacity/livevotingkeystore')
        storePassword 'xxxxxx'
    }
}

How do I save to a relative path? I am very confused.

like image 990
tccpg288 Avatar asked Oct 27 '18 19:10

tccpg288


1 Answers

A relative path is a way to specify the location of a directory relative to another directory.


According to your code, your keystore file is located here.

/Users/user/Applications/LiveVotingUdacity/livevotingkeystore

And build.gradle file, which you use to specify signingConfigs, is placed inside you app folder:

/Users/user/Applications/LiveVotingUdacity/app

You need somehow specify that keystore file is located one folder above in folder tree. There is .. symbol which literally means 'parent directory'.

So to specify relative path to your keystore, you should use the next path

storeFile file('../livevotingkeystore')
like image 63
Alexey Denysenko Avatar answered Oct 11 '22 14:10

Alexey Denysenko