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.
 

Emerito

Active Member
Licensed User
Longtime User
Thank you, Erel
That topic is solved with your help, but I find that Google asks a lot of things to publish the app. I will try to solve them.
Greetings.
 

KMatle

Expert
Licensed User
Longtime User
Here's a summary:

- the private key stands more for the creator (you) of the app. So it is created once for all of your future apps.
- so you can only update using the same key and a different (higher) version (so loosing the key = no updates anymore = new app)
- if you create several apps, you will use the same private key for all apps
- each app must have a unique package name as it competes with all other apps
- example: us.petersmith.app1, us.petersmith.app2, us.petersmith.app3 (all with the same private key to identify you as the creator)

When I start a new app, I change the package name at once to a unique one (de.xxxxx.mynewapp). The folder where I save the code and the sourcecode has the same name. Very easy. No confusion.

Important: Save the private sign key twice! If it get's lost, you are in trouble (at least you can't update a previous version. It is handled as a new version).
 

Emerito

Active Member
Licensed User
Longtime User
Here's a summary:

- the private key stands more for the creator (you) of the app. So it is created once for all of your future apps.
- so you can only update using the same key and a different (higher) version (so loosing the key = no updates anymore = new app)
- if you create several apps, you will use the same private key for all apps
- each app must have a unique package name as it competes with all other apps
- example: us.petersmith.app1, us.petersmith.app2, us.petersmith.app3 (all with the same private key to identify you as the creator)

When I start a new app, I change the package name at once to a unique one (de.xxxxx.mynewapp). The folder where I save the code and the sourcecode has the same name. Very easy. No confusion.

Important: Save the private sign key twice! If it get's lost, you are in trouble (at least you can't update a previous version. It is handled as a new version).

Thanks i take note
 

ivan.tellez

Active Member
Licensed User
Longtime User
Android market doesn't accept APK files signed with this key.

Well, starting this year, I had to upload a new App, Created, compliled, uploaded, no problem.
Two monts ago, I updated an old app, Google play console said it has the wrong signature, go to tools, private sign key, and discover It was configured the debug key.
Today had to update this year's app and again had the same error on Google play console, go to tools, private sign key, and wass correct.

Yeap, an B4A update broken the key config at the beginning of the year and I uploaded an App signed with the Debug key. Had to use debug key to update the app today.

So, Is there a way to change the key without deleting the app from google play?
 

mlc

Active Member
Licensed User
Longtime User
Hello,

Until now, I uploaded my apps to my usual google account.

But I have created a company with a friend, to make an app, I will upload it to the google account of the company. Should I create a new private sign key for this app?

Thanks
 

Marcelo Quintanilha

Member
Licensed User
Caro Erel, segui como descrito mais continua dando erro ...
[ATTACH = cheio] 64953 [/ ATTACH]
 

Attachments

  • upload_2018-2-24_18-19-14.png
    upload_2018-2-24_18-19-14.png
    53 KB · Views: 823
Status
Not open for further replies.
Top