apksigner, zipalign and jarsigner not working as expected












0














I have created a Xamarin Form application using Visual Studio 2017 in Windows 10 and archived the android application to APK file.



When I upload the APK to Google Play console to update my existing app, it says the APK is not signed. Then I used this command to sign the APK using the same certificate



apksigner sign --ks <KEYSTORE_FILE_NAME> --ks-key-alias <ALIAS_NAME> <APK_FILE_NAME>



When I try to upload the signed APK, it says the APK is not zipaligned. Then I used this command to zipalign



zipalign -f -v 4 <OLD_APK_FILE_NAME> <NEW_APK_FILE_NAME>



When I upload the zipaligned APK to console, it says the APK is not signed. After I sign using apksigner it says it is not zipaligned. I am keep on circulating in the same circle again and again.



Even after I zipalign the APK first and then sign, Same error messages are displaying again and again in same circle.



Even if I used jarsigner, the situation is same.



I followed the steps given here



https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing/signing-the-app-package/manually-signing-the-apk/



But the APK not getting uploaded. What am I doing wrong?



Please note this is not a duplicate question.










share|improve this question


















  • 1




    apksigner requires you to zipalign prior. jarsigner requires you to zipalign after. These steps are automated by the Archive Workflow in Visual Studio.
    – Jon Douglas
    Nov 19 '18 at 21:11










  • @Jon this is the correct answer, can you make it a top level answer instead of a comment?
    – Pierre
    Nov 19 '18 at 21:52










  • Feel free to write up your own answer based off of what resolved your problem and accept it.
    – Jon Douglas
    Nov 19 '18 at 22:13










  • What is your Android SDK version? over or below v24.0.3?
    – AbbyWang
    Nov 20 '18 at 5:44










  • @lemontree SDK version 27
    – A.M.Roomi
    Nov 21 '18 at 0:26
















0














I have created a Xamarin Form application using Visual Studio 2017 in Windows 10 and archived the android application to APK file.



When I upload the APK to Google Play console to update my existing app, it says the APK is not signed. Then I used this command to sign the APK using the same certificate



apksigner sign --ks <KEYSTORE_FILE_NAME> --ks-key-alias <ALIAS_NAME> <APK_FILE_NAME>



When I try to upload the signed APK, it says the APK is not zipaligned. Then I used this command to zipalign



zipalign -f -v 4 <OLD_APK_FILE_NAME> <NEW_APK_FILE_NAME>



When I upload the zipaligned APK to console, it says the APK is not signed. After I sign using apksigner it says it is not zipaligned. I am keep on circulating in the same circle again and again.



Even after I zipalign the APK first and then sign, Same error messages are displaying again and again in same circle.



Even if I used jarsigner, the situation is same.



I followed the steps given here



https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing/signing-the-app-package/manually-signing-the-apk/



But the APK not getting uploaded. What am I doing wrong?



Please note this is not a duplicate question.










share|improve this question


















  • 1




    apksigner requires you to zipalign prior. jarsigner requires you to zipalign after. These steps are automated by the Archive Workflow in Visual Studio.
    – Jon Douglas
    Nov 19 '18 at 21:11










  • @Jon this is the correct answer, can you make it a top level answer instead of a comment?
    – Pierre
    Nov 19 '18 at 21:52










  • Feel free to write up your own answer based off of what resolved your problem and accept it.
    – Jon Douglas
    Nov 19 '18 at 22:13










  • What is your Android SDK version? over or below v24.0.3?
    – AbbyWang
    Nov 20 '18 at 5:44










  • @lemontree SDK version 27
    – A.M.Roomi
    Nov 21 '18 at 0:26














0












0








0







I have created a Xamarin Form application using Visual Studio 2017 in Windows 10 and archived the android application to APK file.



When I upload the APK to Google Play console to update my existing app, it says the APK is not signed. Then I used this command to sign the APK using the same certificate



apksigner sign --ks <KEYSTORE_FILE_NAME> --ks-key-alias <ALIAS_NAME> <APK_FILE_NAME>



When I try to upload the signed APK, it says the APK is not zipaligned. Then I used this command to zipalign



zipalign -f -v 4 <OLD_APK_FILE_NAME> <NEW_APK_FILE_NAME>



When I upload the zipaligned APK to console, it says the APK is not signed. After I sign using apksigner it says it is not zipaligned. I am keep on circulating in the same circle again and again.



Even after I zipalign the APK first and then sign, Same error messages are displaying again and again in same circle.



Even if I used jarsigner, the situation is same.



I followed the steps given here



https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing/signing-the-app-package/manually-signing-the-apk/



But the APK not getting uploaded. What am I doing wrong?



Please note this is not a duplicate question.










share|improve this question













I have created a Xamarin Form application using Visual Studio 2017 in Windows 10 and archived the android application to APK file.



When I upload the APK to Google Play console to update my existing app, it says the APK is not signed. Then I used this command to sign the APK using the same certificate



apksigner sign --ks <KEYSTORE_FILE_NAME> --ks-key-alias <ALIAS_NAME> <APK_FILE_NAME>



When I try to upload the signed APK, it says the APK is not zipaligned. Then I used this command to zipalign



zipalign -f -v 4 <OLD_APK_FILE_NAME> <NEW_APK_FILE_NAME>



When I upload the zipaligned APK to console, it says the APK is not signed. After I sign using apksigner it says it is not zipaligned. I am keep on circulating in the same circle again and again.



Even after I zipalign the APK first and then sign, Same error messages are displaying again and again in same circle.



Even if I used jarsigner, the situation is same.



I followed the steps given here



https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing/signing-the-app-package/manually-signing-the-apk/



But the APK not getting uploaded. What am I doing wrong?



Please note this is not a duplicate question.







android xamarin.android google-play apk android-install-apk






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 19 '18 at 13:53









A.M.Roomi

716




716








  • 1




    apksigner requires you to zipalign prior. jarsigner requires you to zipalign after. These steps are automated by the Archive Workflow in Visual Studio.
    – Jon Douglas
    Nov 19 '18 at 21:11










  • @Jon this is the correct answer, can you make it a top level answer instead of a comment?
    – Pierre
    Nov 19 '18 at 21:52










  • Feel free to write up your own answer based off of what resolved your problem and accept it.
    – Jon Douglas
    Nov 19 '18 at 22:13










  • What is your Android SDK version? over or below v24.0.3?
    – AbbyWang
    Nov 20 '18 at 5:44










  • @lemontree SDK version 27
    – A.M.Roomi
    Nov 21 '18 at 0:26














  • 1




    apksigner requires you to zipalign prior. jarsigner requires you to zipalign after. These steps are automated by the Archive Workflow in Visual Studio.
    – Jon Douglas
    Nov 19 '18 at 21:11










  • @Jon this is the correct answer, can you make it a top level answer instead of a comment?
    – Pierre
    Nov 19 '18 at 21:52










  • Feel free to write up your own answer based off of what resolved your problem and accept it.
    – Jon Douglas
    Nov 19 '18 at 22:13










  • What is your Android SDK version? over or below v24.0.3?
    – AbbyWang
    Nov 20 '18 at 5:44










  • @lemontree SDK version 27
    – A.M.Roomi
    Nov 21 '18 at 0:26








1




1




apksigner requires you to zipalign prior. jarsigner requires you to zipalign after. These steps are automated by the Archive Workflow in Visual Studio.
– Jon Douglas
Nov 19 '18 at 21:11




apksigner requires you to zipalign prior. jarsigner requires you to zipalign after. These steps are automated by the Archive Workflow in Visual Studio.
– Jon Douglas
Nov 19 '18 at 21:11












@Jon this is the correct answer, can you make it a top level answer instead of a comment?
– Pierre
Nov 19 '18 at 21:52




@Jon this is the correct answer, can you make it a top level answer instead of a comment?
– Pierre
Nov 19 '18 at 21:52












Feel free to write up your own answer based off of what resolved your problem and accept it.
– Jon Douglas
Nov 19 '18 at 22:13




Feel free to write up your own answer based off of what resolved your problem and accept it.
– Jon Douglas
Nov 19 '18 at 22:13












What is your Android SDK version? over or below v24.0.3?
– AbbyWang
Nov 20 '18 at 5:44




What is your Android SDK version? over or below v24.0.3?
– AbbyWang
Nov 20 '18 at 5:44












@lemontree SDK version 27
– A.M.Roomi
Nov 21 '18 at 0:26




@lemontree SDK version 27
– A.M.Roomi
Nov 21 '18 at 0:26












1 Answer
1






active

oldest

votes


















0














apksigner requires you to zipalign prior to signing. jarsigner requires you to zipalign after signing. This is documented in the zipalign docs.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53376136%2fapksigner-zipalign-and-jarsigner-not-working-as-expected%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    apksigner requires you to zipalign prior to signing. jarsigner requires you to zipalign after signing. This is documented in the zipalign docs.






    share|improve this answer


























      0














      apksigner requires you to zipalign prior to signing. jarsigner requires you to zipalign after signing. This is documented in the zipalign docs.






      share|improve this answer
























        0












        0








        0






        apksigner requires you to zipalign prior to signing. jarsigner requires you to zipalign after signing. This is documented in the zipalign docs.






        share|improve this answer












        apksigner requires you to zipalign prior to signing. jarsigner requires you to zipalign after signing. This is documented in the zipalign docs.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 30 '18 at 10:50









        Nick Fortescue

        5,4311422




        5,4311422






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53376136%2fapksigner-zipalign-and-jarsigner-not-working-as-expected%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

            Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

            A Topological Invariant for $pi_3(U(n))$