Android Tutorial Signing your application before uploading to Google Play

Discussion in 'Tutorials & Examples' started by Erel, Dec 5, 2010.

Thread Status:
Not open for further replies.
  1. Erel

    Erel Administrator Staff Member Licensed User

    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

    [​IMG]

    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:
    [​IMG]

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

    GeoTrail Member Licensed 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.
     
  3. Erel

    Erel Administrator Staff Member Licensed User

  4. GeoTrail

    GeoTrail Member Licensed 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.
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    The manifest is included in the APK file. There is a field in the market upload form for uploading an image as an icon.
     
  6. mistermentality

    mistermentality Active Member Licensed 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
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    No. Nothing has changed in v1.6 related to signing keys.
     
  8. demasi

    demasi Active Member Licensed 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: Jul 28, 2011
  9. Erel

    Erel Administrator Staff Member Licensed User

    The key is saved in this file. You should choose the saving location.
     
  10. rafaelbrasilia

    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
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    For some reason you appear as an unlicensed user. Please contact support@basic4ppc.com in order to fix it.
     
  12. timo

    timo Active Member Licensed 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: Oct 19, 2011
  13. Erel

    Erel Administrator Staff Member Licensed User

    The value set is the maximum allowed. More than 28 years if I remember correctly.
     
  14. timo

    timo Active Member Licensed User

    Thanks
     
  15. davidmd

    davidmd Member Licensed 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.
     
    iwan.deejay likes this.
  16. chfajardo

    chfajardo Member Licensed 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.
     
  17. Erel

    Erel Administrator Staff Member Licensed User

    Are you sure that the old file wasn't modified? Is the password correct?
     
  18. chfajardo

    chfajardo Member Licensed 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.
     
  19. chfajardo

    chfajardo Member Licensed 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.
     
  20. chfajardo

    chfajardo Member Licensed 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.
     
Thread Status:
Not open for further replies.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice