0

What I need to happen: using a relative path for my keystore in my gradle to work.

Things I have tried:

storeFile file('../keystore.jks')

storeFile file("$rootDir/keystore.jks")

I have also tried it with not adding .jks at the end of the keystore name. But I get the same error. I am under the release variant. I am using the Build APK option to build the APK.

This is what my code looks like in my gradle:

android {
signingConfigs {
    config {
        keyAlias 'key0'
        keyPassword 'testpassword'
        storeFile file('../keystore')
        storePassword 'testpassword'
    }
  }

  buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.config
    }
   }

This is the error I get:

Keystore file 'C:\Users\zzyzj\Documents\Android_Projects\EloterManResources\EloteMan\version\Udacity\eloteroMan\keystore' not found for signing config 'config'.

1 Answer 1

1

You should use rootProject.file to access the keystore file. Something like this:

signingConfigs {
config {
    keyAlias 'key0'
    keyPassword 'testpassword'
    storeFile rootProject.file('keystore.jks')
    storePassword 'testpassword'
}
}

This is for the case when the keystore is in your root folder.If it's in some other folder give the correct relative path.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.