Android Tutorial Signing your application before uploading to Google Play

Status
Not open for further replies.
The result of compiling your application is an APK file. This is a package file that contains the compiled source code and the assets files.
The APK file must be signed before installation. Signing the file means that it is not possible to later modify it without the private key that was used to sign the file.
Android devices will not install an unsigned APK file.

Basic4android uses a default "debug key" to sign applications. This key is fine during debugging. However Android market doesn't accept APK files signed with this key.
You need to create your own private key.
Fortunately it is pretty simple to create such key.
Choose Tools - Private Sign Key

sign_1.png


This dialog allows you to create a new key, load an existing one or to use the debug key.
Keys are stored in a keystore file.
It is not possible to access such a file without its password.

Once you created a new keystore file, Basic4android will use this key for all your projects.
You should be very careful with this file. If this file gets lost you will not be able to update your applications in the market. You will need to publish updates as new applications.
It is impossible to recreate a lost keystore file.
Therefore it is recommended to backup this file.

In the IDE, when you reinstall an application and use a different key, you will see this message:
sign_2.png


Pressing yes will uninstall the previous application and install the new one.
 

GeoTrail

Member
Licensed User
Longtime User
I tried compiling a small app to test.
It worked great on the emulator, but when I ran it on my phone, it just displayed a black screen with the title I added.

And when I tried uploading it to the Market Place, I got errors like, missing icons and stuff. Can't remember them all now, I'm at work and can't install it here.
 

GeoTrail

Member
Licensed User
Longtime User
Yeah I figured that. But I'm not sure exactly what to fill in, or how to add the icon. The manifest isn't supposed to be uploaded?

Sorry about posting in the wrong place.
You just reminded me of the problem I had when I read your post here.
 

mistermentality

Active Member
Licensed User
Longtime User
Excuse me for asking a silly question but with a previous version of B4A I had to manually sign my apk files with my key if not using one generated by b4A.

I tried with the new version (1.6) loading my keystore in and this time get no warnings during compile, does this mean it has changed and can now use a non b4a generated key?

Dave
 

demasi

Active Member
Licensed User
Longtime User
What is this "file" in the sign dialog?

Please help: what is this file to be filled in the "private sign key" dialog? (first message) where can I find it?
 
Last edited:

rafaelbrasilia

New Member
Problems creating new key.

Hi,
I'm truing to create a new keystore file but I keep getting this Invalid file message.

I put in my name, organization, country, and password, And when I hit ok i get this message saying Invalid file.
Should i chose a file in the file field, even though I want to create a new keystore file?

thanks!
rafael
 

timo

Active Member
Licensed User
Longtime User
This key system is very pratical. I couldn't anyway see wich is the expiration date of the key. Did you put the standard 10000 days? Thanks.
 
Last edited:

davidmd

Member
Licensed User
Longtime User
I love B4A

Hi

It is Genuine and so Simple
I just Upload my First App to Andr. Market.
It is So easy and Fun with B4A , Compare
to Apple Xcode Headache and difficulity.
 

chfajardo

Member
Licensed User
Longtime User
Problem loading B4A generated keystore files

Erel,

I was signing my application without problems, but then i decided to use a diferent Private sign key, so i created it and used it well. But now, when i try to use the old .keystore file, it gives me this message:

Error loading keystore file
Tipo de armazenamento de chaves: JKS
Fornecedor de armazenamento de chaves: SUN
erro de keytool: java.lang.IllegalArgumentException: unknow format type at

Even if i try to load the working .keystore file it gives me this message if i choose the file from the browse button.

I really have to get this working, because i already have some applications published in Android Market and i do need to use the same .keystore files.
These applications where created using Basic4Android and the .keystore files where created using Basic4Android.
 

chfajardo

Member
Licensed User
Longtime User
Problem loading B4A generated keystore files

Erel,

Yes, the file is good and the password is OK. I have used Keystore Explorer 4.01 to open them with success.
When the name of the keystore file is already filled, it is ok, but if i try to browse and open the same file, it gives me the error again.
 

chfajardo

Member
Licensed User
Longtime User
Problem loading B4A generated keystore files

I have confirmed what i said. When the keystore file path and name are already there, it works fine, but if i try to click browse and select it, it gives me the same error i reported earlier.
Is there some file or configuration i can use to change the default keystore file showed in the dialog?
I'm pretty sure that the problem occurs when i ask to load the file.
 

chfajardo

Member
Licensed User
Longtime User
Problem loading B4A generated keystore files

Erel,

After testing with several keystore files, i concluded that Basic4Android is not working well when i click to browse the keystore file and use it.
Even after creating a keystore file and right after it, trying to browse and use it is giving me the same error message.
Can this be fixed?
All i need is to be able to choose the keystore file and use it.
 
Status
Not open for further replies.
Top