Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Generating Signed APK "KeyStore file not set for signing config release"

Tags:

I am trying to generate a signed APK. I have my password.keystore file located in \Dictionary\android\app and when i ran gradlew assembleRelease on cmd, the error:

Execution failed for task ':app:validateSigningRelease'.

Keystore file not set for signing config release

Where should I store my password.keystore file? Because when I commented off the if (project.hasProperty("password.keystore") { it seems to work but with the following error instead:

Unable to process incoming event 'ProgressComplete ' (ProgressCompleteEvent)

How should I write my if condition or where should I store the password.keystore file?

The source code is as follows:

signingConfigs {   release {     if (project.hasProperty("password.keystore")) {       storeFile file("password.keystore")       storePassword "password"       keyAlias "username"       keyPassword "password"     }   } } 
like image 484
Benjamin Avatar asked Jun 05 '17 08:06

Benjamin


2 Answers

The keystore file has to be in the android/app folder.

The message 'Keystore file not set for signing config release' has to do that there is no signingConfig in the android/app/build.gradle file.

buildTypes {     release {         // other settings         signingConfig signingConfigs.release     } } 

For testing you can just hard coded the settings in the android/app/build.gradle, instead off set it in the gradle.properties. This was fixing for me the problem with 'Keystore was tampered with, or password was incorrect'

  signingConfigs {     release {         //if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {             storeFile file("key.keystore")             storePassword "****"             keyAlias "myKey"             keyPassword "****"        // }     } } 
like image 79
Yoruba Avatar answered Sep 21 '22 13:09

Yoruba


In my case, my project was on RN version 0.59 while I was using 0.60 RC documentation. So inside app/build.gradle

If version 0.59 :

if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {

If version 0.60 :

if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {

The difference is the change from RELEASE to UPLOAD

like image 33
Scar Coder Avatar answered Sep 23 '22 13:09

Scar Coder