Android Question Build error due to alias in keystore?

Sifu

Active Member
Hello,

I got this error while building aab:
error:
jarsigner: Certificate chain not found for: b4a.  b4a must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.
I suspect the fault is because my keystore uses not the b4a alias. I created keystore with another alias.
It seems b4a does not accept it or uses it's own b4a alias. Is it so?
And if so, how to use my own alias?

I used this:
keystore:
keytool.exe -genkey -v -keystore myapp.keystore -alias myapp -keyalg RSA -keysize 2048 -validity 10000

I know I can use the build in generator, but I want to use my own. With own alias.

Thanks for any help.
 

Sifu

Active Member
Could it give problems in the future using the same alias over and over for different Android projects, because each project needs it's own key?
For example when needing to import a certificate?

I'm reading this at Oracle, but I could be misunderstanding.
Oracle keytool:
You import a certificate for two reasons:

    to add it to the list of trusted certificates, or
    to import a certificate reply received from a CA as the result of submitting a Certificate Signing Request (see the -certreq command) to that CA.

Which type of import is intended is indicated by the value of the -alias option:

    If the alias does not point to a key entry, then keytool assumes you are adding a trusted certificate entry. In this case, the alias should not already exist in the keystore. If the alias does already exist, then keytool outputs an error, since there is already a trusted certificate for that alias, and does not import the certificate.
    If the alias points to a key entry, then keytool assumes you are importing a certificate reply.
Could someone please clarify?
 
Upvote 0

Sifu

Active Member
Looks to be solved using #SignKeyAlias:
Now the aab was created succesfully.
Found it on this site via Google search.

Thanks!
 
Upvote 0
Top