Android Tutorial Cannot sign apk with valid key in B4A

I have a couple of apps I created in appinventor and signed with my key but when I try to use the same, working, key in B4A it gives me this 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."

This was simply from trying to run some of the demos now I have purchased the full version.

From the ide I went to private key and loaded in my key, and I know it works elsewhere as I use it for my market apps, so any idea what is stopping it working here?

I am a B4A newb but as far as I can tell I have done everything right so it should be working.

Alternatively, if I create a new key will this affect my apps when I upload them to the market as they key would be different to the one used for my current apps and I don't know how that would affect when I publish app upgrades?

Dave
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Basic4android expects the key alias to be "b4a". Keys generated with Basic4android will work properly.
You can compile your app without signing (Alt + 2) and then manually sign the apk file with any valid key.
See this link for more instructions: Signing Your Applications | Android Developers
You cannot update an existing market app using a different key.
 

mistermentality

Active Member
Licensed User
Longtime User
The only problem with that is that if I compile it unsigned the apk does not appear in the objects folder and doesn't seem to exist anywhere with an apk only being generated if I compile with a key.

Where is the apk placed if I compile with no key as it seems to disappear if I don't compile it signed?

All the files except an apk are generated and I get this message:
"Compiling code. 0.02
Generating R file. 0.32
Compiling generated Java code. 1.42
Convert byte code - optimized dex. 2.89
Standard dexer.
Packaging files. 0.37
Completed successfully."

But no apk.

Edit: this is weird, but a search by the computer can find no apk file anywhere on my computer after I compile it without signing yet I get the success message from the IDE that it compiled so could this be a bug?

Dave
 
Last edited:
Top