Android Studio cannot find file

I added the signature keys to a folder keysin the root directory of the project:

.\

   keys\
       sign.properties
   src\
       main\
   build.gradle

I added the following 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 gradle build command line can assemble the assembly. However, Android Studio gives me an error that the file was sign.propertiesnot found.

How to point AS to it?

+1
source share
1 answer

It seems that the problem is that the working directory is when compiling on the command line or compiling from Android Studio. I see a discrepancy there that I need to investigate further and possibly point out an error. In any case, it is better to clearly indicate the path in order to prevent confusion.

Try the following:

p.load(new FileInputStream(rootProject.file('keys/sign.properties')))

, project ( module), settings.gradle.

https://code.google.com/p/android/issues/detail?id=64018 . , , , , .

+4

Source: https://habr.com/ru/post/1531910/


All Articles