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.
 

tofd

New Member
Licensed User
Longtime User
Yes with my v1.8 the Keystore was inside the Objects folder.
I just change to another folder and all is OK now!
Very thank you Erel ;).
 
U

unba1300

Guest
Can this process be done at any stage during the development of an app, or should we wait until all debugging is done? Thanks.
 
U

unba1300

Guest
What should we enter in the Organization field if we don't have a company name? Or should it be left blank?
 

Shadow&Max

Active Member
Licensed User
Longtime User
Erel... I just want to be clear about this before I release my app...

I created a key but I didn't know exactly what I was doing and hadn't read the thread yet. This was a while ago.

Now, I want to create a new key, store it, and make sure the app uses it. Will the old key conflict with the new key in any way? I don't remember doing anything else other than creating the key and I do know where the first one's saved.

If I create a new key, is there anything I have to do to the app to use the new one I created? This is where I'm confused. When I created the key the first time, does B4A store reference to that and use it from there on? So, if I create a new key in another location, will it replace the old key I created inside of B4A?

I really don't want to screw up here... especially now after all this work.

****************************
OK, I think I've got this but just want to be sure. I made a new key, saved it and it's info (email to myself with screenshots, typed codes, and the keystore attached). I also compiled the app and tried to load it to my phone but it failed because the identification didn't match... then uninstalled the app from the phone, and reinstalled from B4A and it worked fine.

So, if I'm correct, now, that keystore that I saved will ALWAYS be used by B4A until I change it (which I probably won't do again now), and I never have to worry about this again as long as the saved keystore file is there where I saved it??? Is this correct?
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
So, if I'm correct, now, that keystore that I saved will ALWAYS be used by B4A until I change it (which I probably won't do again now), and I never have to worry about this again as long as the saved keystore file is there where I saved it??? Is this correct?
Yes. The only thing you need to make sure is that you have a backup copy. Other than that you cannot do any mistake. Google will not let you upload your app if it is signed with the wrong key.
 

Shadow&Max

Active Member
Licensed User
Longtime User
OK, then all set... Thanks Erel!
 

achtrade

Active Member
Licensed User
Longtime User
I'm creating a keystore for first time, but I'm getting this error:

Error creating keystore file
Keytool error: java.io.IOExecption: Incorrect AVA format

what's wrong ?
 

AlexMinz

Member
Licensed User
Longtime User
I dont know whether I used debugged key or new key. Google Play accepted the file. Is that a sign that I take a new key?
 

basicly_me

Member
Licensed User
Longtime User
Hi,

I have tried to get rid of «b4a.example» without any success. This text is nowhere to be found in my sourcecode, but somehow it ends up being in the AndroidManifest.xml
I have edited this file, changing «b4a.example», but when I press f5 and compile, the «b4a.example» has returned to the AndroidManifest.xml.

There must be a file somewhere that can be edited so «b4a.example» dissappears?
 

basicly_me

Member
Licensed User
Longtime User
No, I have changed the #ApplicationLabel: a long time ago, but it doesn't help. It seems that some other file that I don't know of needs to be edited.
 

basicly_me

Member
Licensed User
Longtime User
Found the solution: Project/Package Name. Changed it from b4a.example which has been there since I installed. Should have found out earlier, sorry.
 
Status
Not open for further replies.
Top