Error while running zipalign

前端 未结 18 1718
眼角桃花
眼角桃花 2021-02-06 21:48

I got this error when trying to export a signed apk in Eclipse

Error while running zipalign: Unable to open as zip archive

I have run the Help->Check for Updat

相关标签:
18条回答
  • 2021-02-06 21:59

    If your pre-align APK is larger than 2GB, it will also cause this issue. Tested with build-tools 23.0.1 on Windows 10 machine.

    0 讨论(0)
  • 2021-02-06 21:59

    zipalign tool can't access to the source file, so you should verify path, file name, extension, permissions ...

    0 讨论(0)
  • 2021-02-06 22:02

    I had to provide the full path for the unsigned APK file: platforms/android/build/outputs/apk/android-release-output.apk

    0 讨论(0)
  • 2021-02-06 22:07

    I had to run cmd from project folder where the

    C:\Users\User\Documents\phone app\7\proj7\platforms\android\build\outputs\apkandroid-release-unsigned.apk is located and enter this in cmd C:\Users\User\AppData\Local\Android\Sdk\build-tools\26.0.0\zipalign -v 4 android-release-unsigned.apk myApp-signed.apk

    0 讨论(0)
  • 2021-02-06 22:08

    I had this same problem and yes, it was because the tool could not recognize the path. I was using the wrong slash because I got bad advice from a developer blog.

    Sample line command if the file "origin.apk" is in a folder called “storage” in the C directory:

    zipalign -f -v 4 “c:\storage\origin.apk” “c:\storage\done.apk”
    

    Make sure you use the slash above the enter key...a lot of the "examples" I have seen use the one by the shift key and that will not work. This will take the apk called “origin.apk” and zipalign it and then save it to the same directory as the file “done.apk”.

    Maybe this is just on Vista, I dont know. I am using Windows Vista 32-bit.

    0 讨论(0)
  • 2021-02-06 22:08

    In my case, I ran the command from the directory where the unsigned apk was and it ran perfectly.

    cd /platforms/android/build/outputs/apk
    zipalign -v 4 android-release-unsigned.apk signed.apk 
    

    This way, I didn't need to worry about specifying the directory.

    ps: I did this on ubuntu.

    0 讨论(0)
提交回复
热议问题