Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business


OverviewFelgo 1 Support › Signing an .apk

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
  • #6949


    Is there an easy way to sign your .apk for Google Play? I can’t seem to figure out how to open my project in Eclipse. Is there a good tutorial out there?



    Hi edomich,

    As stated in the publish guide, you can sign it with the jarsigner. After you have set up your keystore ect it could look like:

    jarsigner -storepass YOURPASSWORD -keystore YOURKEYSTORE_key.keystore YOURAPP-release-unsigned.apk YOURKEYSTORE_key
    zipalign -f 4 YOURAPP-release-unsigned.apk YOURAPP_release.apk
    jarsigner -verify YOURAPP_release.apk 





    Thanks for your help David. I eventually got this to work but definitely not easy to figure out for a newbie. Do you have to perform this operation each time you send an updated .apk to Google Play?



    You are welcome! Basically yes, each update needs to be signed before it can be uploaded in the Google Play Store!





    Joshua Hiwat

    I am a newbie by this, can someone help me with this or have you a tuturial that i can read?





    I am going to make a tutorial either today or tomorrow to show what I did.



    Joshua Hiwat



    Thnx, i will see it soon, i hope you het it for tonight or els tomorrow.





    This is a tutorial for signing and aligning your publish builds for Google Play Store submission. Note: you need a Pro Felgo account in order to build a “Publish Build” instead of “Test Build”. Once you purchase your Felgo license, you need to update your config.json file in your app’s QML folder and add the following line: “stage”: “publish”,

    Send the contents of your QML folder to a compressed folder and upload it to the v-Play build server. I have had problems uploading from Firefox 27, so I have been using Chrome. Download your .apk which will be named yourapp-release-unsigned.apk.

    Download and install Java JDK (not JRE)

    Here’s where the fun begins.

    1. Copy yourapp-release-unsigned.apk
    2. Navigate to your JDK folder. In my case, it was installed in the default location of C:\Program Files\Java\jdk1.7.0_51
    3. Open the bin folder, and make sure the jarsigner and keytool are there. If they aren’t, make sure you downloaded and navigated to the JDK folder and not JRE.
    4. Paste a copy of your .apk into this folder. (Trust me, it makes the process easier)
    5.Now you need to create a “keystore”. Open your command prompt and “cd” to the bin folder. Just type the following:
    cd C:\Program Files\Java\jdk1.7.0_51\bin and press enter. Note: your bin location may be different depending on where you installed your JDK. If you are successful, the command line should have changed to show you are now starting in the bin folder of JDK.

    Enter the following into you command line:
    keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

    I chose to replace “my-release-key.keystore” with “myapp.keystore”, and “alias_name” with the name of my app.

    Press enter and you should be asked a few questions like your first and last name, organizational unit (I entered Application Development), Organization (I chose the name of my Google Play developer account), city, state, and 2-letter country code (mine was US).

    By the way, when you choose your password, it may seem like nothing is being typed in the cmd, but it is. Just make sure you’re careful. You need to type your password twice anyway.

    Now you should have a file in your bin folder called yourapp.keystore, or whatever you named it in the previous step.

    6. Now you will sign your apk with jarsigner. enter the following into your command prompt (make sure you’re still at your bin folder).

    jarsigner -storepass YOURPASSWORD -keystore YOURKEYSTORENAME.keystore YOURAPP-release-unsigned.apk YOURKEYSTORENAME

    7. You need Android SDK for this next step. Download it here: http://developer.android.com/sdk/index.html

    As you did previously with your jdk\bin folder, you will have to “cd” to the following folder:
    cd C:\…adk-bundle….\sdk\tools

    you will be using the zipalign tool, so make sure it is in that folder. Enter this into the cmd:

    zipalign -f 4 YOURAPP-release-unsigned.apk YOURAPP_release.apk

    Note: I pointed YOURAPP-release-unsigned.apk to the file I created in the previous step by entering the following:

    zipalign -f 4 C:\Program Files\Java\jdk1.7.0_51\bin\YOURAPP-release-unsigned.apk YOURAPP_release.apk

    I believe I had trouble with permissions the first time I tried this, so I right-clicked on the jdk bin folder and changed my permissions so I modify the file.

    If you are successful, a new file should appear in your sdk\tools folder called YOURAPP_release.apk.

    8. Verify everything worked by “cd” back to the jdk\bin and running:
    jarsigner -verify YOURAPP_release.apk

    Note: you need to point to your release.apk. for example, i used:

    jarsigner -verify C:…\adk…\sdk\tools\YOURAPP_release.apk

    You should be good to go!

    Please let me know if this works for you or if you’re having trouble understanding my directions. If any Felgo team member is reading, tell me if I made a mistake!



    Felgo Team

    Thanks for the tutorial Ed, looking good so far! 🙂



    In step 7, I just realized that I actually copied my signed apk over to the jdk/tools folder before using zipalign. There was no “pointing” as I mistakenly mentioned. It’s much easier to just drop a copy of your file into the folder where the tool is.


    Joshua Hiwat

    I have som problems with step 5, when information and password, he show me the next error:

    [storing my-release-key.keystore]
    keytool error: java.io.FileNotFoundException: my-release-key.keystore <not allowed>
    Java.io.FileNotException: my-release-key.keystore <not allowed>
    at java.io.FileOutpurStream.open<native Method>
    at java.io.FileOutpurStream.<init><FileOutputStream.java:221>
    at java.io.FileOutpurStream.<init><FileOutputStream.java:110>
    at sun.security.tools.KeyTool.doCommands<KeyTool.java:1152>
    at sun.security.tools.KeyTool.run<KeyTool.java:340>
    at sun.security.tools.KeyTool.main<KeyTool.java:333>


    What did i worng?



    Try running your command as Admin. Right-click, run-as administrator. Let me know if this helps.


    Joshua Hiwat

    it work but i have another problem with step 6.

    jarsigner: Certificate chain not found for: my-release-key. my-release-key must reference a valid Keystore key entry containing a private key and corresponding public key certificate chain.


    My Command was:
    jarsigner -storepass ******** -keystore my-release-key.keystore yourapp-release-unsigned.apk my-release-key



    Is your .keystore located in your bin folder? Make sure you have a copy of it in the same location as the jarsigner tool.


    Joshua Hiwat

    Both of the files are in my bin folder, but what is the problem ?

    You can mail it me at mail@joshualonden.com Thnx. Edomich !!

Viewing 15 posts - 1 through 15 (of 19 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded