26

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.

user3071284
  • 6,955
  • 6
  • 43
  • 57
Barney Chambers
  • 2,720
  • 6
  • 42
  • 78
  • http://forum.unity3d.com/threads/cant-build-apk-urgent-help-needed-solved.254106/ – JRowan Jul 01 '14 at 03:25
  • Please marked an answer as accepted if you're happy with it, or alternatively state why the answers are not acceptable. – OMGtechy Sep 04 '14 at 20:31

6 Answers6

50
  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
OMGtechy
  • 7,935
  • 8
  • 48
  • 83
7

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

BlueSilver
  • 1,052
  • 2
  • 10
  • 25
Ciprian
  • 1,125
  • 1
  • 9
  • 14
2

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.

Pepon
  • 21
  • 1
1

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

druss
  • 1,820
  • 19
  • 18
1

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

ermedian
  • 145
  • 2
  • 9
0

I fixed this simply by updating "Tools->Android SDK Build-tools" in the Android SDK Manager to the latest version.

UncleIstvan
  • 982
  • 9
  • 14