问题
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.
回答1:
- Find your copy of the Android SDK in explorer
- Go to
build-tools
and choose a version (e.g.build-tools\19.1.0
) - Copy
zipalign.exe
- Come back out of
build-tools
- Go into
tools
- Paste
zipalign.exe
回答2:
You need to copy the zipalign tool from sdk/build-tools/android-{version}/ to sdk/tools/
回答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.
回答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
回答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
回答6:
I fixed this simply by updating "Tools->Android SDK Build-tools" in the Android SDK Manager to the latest version.
来源:https://stackoverflow.com/questions/24501944/unity-android-build-error-win32-exception-zipalign