Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No key with alias found in keystore

Our android project consists of mobile and wear app ( wear app is under development) and we are trying to release the mobile app. When we try to generate signed apk we get this follow message :

Error:Execution failed for task ':wear:packageRelease'. > com.android.ide.common.signing.KeytoolException: Failed to read key toyanathpatro from store "/home/adventure/toyanath_patro_key/toyanath_patro_key": No key with alias 'toyanathpatro' found in keystore /home/adventure/toyanath_patro_key/toyanath_patro_key 

As it reads it says failed task for :wear:packageRelease where in reality we are selecting just the mobile while choosing for signing the apk.

Can anyone point out my blunder ? Thanks in advance.

like image 454
erluxman Avatar asked Oct 17 '16 07:10

erluxman


People also ask

What is key alias in keystore?

An alias is specified when you add an entity to the keystore using the -genseckey command to generate a secret key, -genkeypair command to generate a key pair (public and private key) or the -importcert command to add a certificate or certificate chain to the list of trusted certificates.

How do I find my alias keystore password?

On the search box top right, type your Android app name or part of the app name. You will see the result line, if you had saved the password. Double click on it, check the show password checkbox, give your system password when asked, and it will show your keystore password.

Can a keystore have multiple alias?

And the only way you can sign with a different alias would be to clone the previous one as the answer also suggests.


2 Answers

The problem seems to be with the wrongly spelled key alias In my case the alias should have been toyanath patro where I wrongly tried to use toyanathpatro . So the best suggestion would be:

  1. Don't use space or invisible character in the key alias. as far as possible

  2. There is a small selection button (3 horizontal dots) on the right side of key alias editable field. Use that button to find the alias which resides in that signature file.

key alias editable field

like image 65
erluxman Avatar answered Sep 20 '22 13:09

erluxman


In your build.gradle you have defined a signing config that it's pointing to a keystore that it's not in your code base.

Something similar to this.

android {     ...     buildTypes {         release {             signingConfig signingConfigs.staging             ...         }     }     signingConfigs {         defaultSignature {             keyAlias 'default'             keyPassword 'password'             storeFile file('default-keystore.jks')             storePassword 'password'         }     } } 
like image 33
Xavier Rubio Jansana Avatar answered Sep 20 '22 13:09

Xavier Rubio Jansana