Unity Android Build Error WIN32 Exception ZipAlign

25,290

Solution 1

  1. Find your copy of the Android SDK in explorer
  2. Go to build-tools and choose a version (e.g.build-tools\19.1.0)
  3. Copy zipalign.exe
  4. Come back out of build-tools
  5. Go into tools
  6. Paste zipalign.exe

Solution 2

You need to copy the zipalign tool from sdk/build-tools/android-{version}/ to sdk/tools/

Solution 3

In Unity go to Edit>Preferences>External Tools> in "Android SDK Location" select the folder of android-sdk (C:\Program Files (x86)\Android\android-sdk) in my case.

Solution 4

You need to copy zipalign as suggested at accepted answer; but if there are no zipalign file in related folder first you should go tools, run android and then install build-tools

Solution 5

To fix this error:

  • Go to C:\Program Files (x86)\Android\android-sdk\build-tools\20.0.0 (you may have different version)
  • Copy zipalign.exe to C:\Program Files (x86)\Android\android-sdk\tools\ (or in your Android SDK path)

Found here

Share:
25,290

Related videos on Youtube

Barney Chambers
Author by

Barney Chambers

Wedding photographer on weekends, blockchain programmer during the week, crypto-coin enthusiast the rest of the time!

Updated on July 14, 2020

Comments

  • Barney Chambers
    Barney Chambers almost 4 years

    Every time I try to build my game for android, I get this error:

    Error building Player: Win32Exception: 
    ApplicationName='.../.../.../.../adt-bundle-mac-x86_64-20140624/sdk/tools/zipalign',
    CommandLine='4"/.../.../.../.../Asteroid2(2)/Temp/StagingArea/Package.apk'". 
    CurrentDirectory='Temp/StagingArea'
    

    Any ideas? I'm stumped. I've redownloaded the SDK and that didn't help.

    • JRowan
      JRowan almost 10 years
    • OMGtechy
      OMGtechy over 9 years
      Please marked an answer as accepted if you're happy with it, or alternatively state why the answers are not acceptable.
  • OMGtechy
    OMGtechy over 9 years
    @BarneyChambers Do you have more than one version of the SDK installed? If so, try doing it for each.
  • Barney Chambers
    Barney Chambers over 9 years
    I only have one version of the SDK, I think I might just reinstall everything and try this fix again
  • OMGtechy
    OMGtechy over 9 years
    @BarneyChambers also check where Unity is looking for the SDK, you might have it in the wrong directory.
  • Jarrod Smith
    Jarrod Smith over 9 years
    And copy it to where?
  • NabeelSaleem
    NabeelSaleem over 8 years
    Thanks it worked for me! and i already shared with my blog readers at unity3diy