Home » Android » android – Error: keystore.properties not found when cloning project

android – Error: keystore.properties not found when cloning project

Posted by: admin June 15, 2020 Leave a comment

Questions:

I’m trying to clone a repository from GitHub. While importing the project I’m getting an error:

E:\ProjectDir\keystore.properties (The system cannot find the file specified)

I’ve never encountered this problem when importing other repos from GitHub.

How to&Answers:

Many projects configure signing of release builds by means of a keystore.properties file. That file would contain properties pointing to where the release keystore is, what passwords to use to access the release key, and so forth. That keystore and the properties files should not be committed to a public version control system.

Hence, when you check out the code from version control, that keystore.properties file will not exist, and Gradle will complain.

There are ways to set up a build.gradle file to avoid this sort of error, checking to see if the file exists and only using its contents if it does. Tactically, in your case, simply commenting out the release build instructions would suffice.

Answer:

Make text file named keystore.properties in the root of project and insert the 4 below parameters in it:

storeFile="relative path to your keystore file"
storePassword="keystore file pass"
keyAlias=
keyPassword=

then rebuild your project.