Reputation: 20130
I added my signing keys into keys
folder in root of the project:
.\
keys\
sign.properties
src\
main\
build.gradle
I added next lines to my build script:
signingConfigs {
release {
Properties p = new Properties()
p.load(new FileInputStream('keys/sign.properties'))
storeFile file(p.file)
storePassword p.password
keyAlias p.alias
keyPassword p.keyPassword
}
}
The command line gradle build is able to assemble build. However Android Studio gives me error that file sign.properties
is not found.
How to point AS to it?
Upvotes: 2
Views: 3524
Reputation: 80010
It looks like a problem with what the working directory is when compiling on the command line vs. compiling from Android Studio. I see a discrepancy there that I need to investigate further and possibly file a bug for. In any event, it's better to be explicit about nailing down the path to prevent confusion.
Try this:
p.load(new FileInputStream(rootProject.file('keys/sign.properties')))
This will nail down the file to be relative to the project (not the module) root, which is also where the settings.gradle
file lives.
EDIT
I filed bug https://code.google.com/p/android/issues/detail?id=64018 for this. The workaround I showed you above should do nicely, and is maybe a best practice in any event.
Upvotes: 4