You uploaded an APK that is not zip aligned error

前端 未结 7 1041
执笔经年
执笔经年 2020-12-03 04:39

I have just finished and signed the apk through android studio, then I have did an apk protect through apkprotect.com when I am trying to upload the apk to play store I go

相关标签:
7条回答
  • 2020-12-03 05:11

    You can run zipalign manually in command line:

    zipalign [-f] [-v] <alignment> infile.apk outfile.apk
    

    Note that zipalign is located inside ${sdk.dir}\tools

    For more details visit zipalign


    [Update]

    Also, If you need to sign it you can run:

    jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore YOURKEYSTORE unsigned.apk alias_name
    

    (jarsigner is located inside java JDK_HOME/bin)

    0 讨论(0)
  • 2020-12-03 05:11

    This question and its answers are old; so we expect things to change. As of today, the zipalign tool is in the ANDROID_HOME directory under build-tools/[version]/ so my path is currently:

    /android-sdk/build-tools/22.0.0/zipalign
    

    Using the zipalign tool is not necessarily the answer here though, what you actually need to do is sign your apk.

    0 讨论(0)
  • 2020-12-03 05:21

    When using the Cordova node.js CLI without going through Android Studio, it is necessary to update the PATH environmental variable to include the android build tools:

    %ANDROID_HOME%\build-tools\29.0.2
    

    Obviously the version number will change over time. Remember to close any CLI windows and re-open them to recognize the newly added path.

    0 讨论(0)
  • 2020-12-03 05:26

    Steps if using Xamarin for VS2017:

    1. Build project
    2. Right click and Archive project
    3. Use Ad Hoc distribution channel
    4. Sign your APK with your Signing Identity and Save As to produce an APK that is ZIP aligned.

    Your APK can be uploaded to Google Play.

    0 讨论(0)
  • 2020-12-03 05:27

    I got the same "You uploaded an APK that is not zip aligned... blah, blah" error when by mistake I tried to upload a DEBUG version of my .apk file to Google Play. It's a bit misleading error because the real problem is that you cannot distribute a debug version which additionally is not signed with your Google Android Developer key. (You can only upload an .apk compiled as release version, and it must be signed, which happens in the same step, at least if you're using Eclipse).

    Make sure you distribute an .apk file which is your Signed Release version, as described here:

    http://developer.android.com/tools/publishing/app-signing.html#releasecompile

    0 讨论(0)
  • 2020-12-03 05:27

    I was using Cordova, uploaded a signed APK but still got this error.

    The ziptool is what helped me, it's located at ~AndroidSDK\build-tools\24.0.0\zipalign.exe

    So for example :

    "~\AndroidSDK\build-tools\24.0.0\zipalign.exe" -f -v 4 android-release-signed.apk android-release-signed-zipaligned.apk
    
    0 讨论(0)
提交回复
热议问题