Can't build apk, urgent help needed. [Solved]

I am new to Unity3D but took some tutorials for PC development and I tried to switch platform to Android to test if the app even opens on my Samsung Galaxy S4 but when I went to Build and Run Unity3D tells me that the device is not found (connected by USB, debugged) and when I try to Build only the following error occurs :

Error building Player: Win32Exception: ApplicationName=‘C:/Users/betam_000/Desktop/adt-bundle-windows-x86_64-20140624/sdk\tools\zipalign.exe’, CommandLine=‘4 “C:\Users\betam_000\Desktop\MakeAGame\Temp/StagingArea/Package_unaligned.apk” “C:\Users\betam_000\Desktop\MakeAGame\Temp/StagingArea/Package.apk”’, CurrentDirectory=‘Temp/StagingArea’

Hope to hear from anyone as soon as possible. Thanks in advance.

2 Likes

i´m in the same problem. not solved. i think it would be something wrong with the sdk update. shit.

edit:
i just read something like to look for the zipaling.exe file and copy it into the sdk/tools folder. im,going to try it later.

the link i´ve translated with google: http://unity3d.ru/distribution/viewtopic.php?f=5&p=176821

edit2:
FIXED aleluyah!!!
here is the file, there one in each version folder, i used this one.
C:\yourpath\adt-bundle-windows-x86-20131030\sdk\build-tools\20.0.0

Copy it to C:\yourpath\sdk\tools\

7 Likes

Thanks so much for the link but I don’t understand the language. Can you please upload the file? Thanks once again for the help.

Edit : Yeah, okay, I’m a little sleepy. Now I understand, let me try this!
Second Edit : Finally, it works! Thanks so much for the help.

It wasn’t clear to me so :

it’s the zipalign.exe file from sdk\build-tools{VERSION} directory that needs to be copied in sdk\tools directory.

Thanks for the tip!

6 Likes

I had to get the android sdk manager to download a new set of the build tools (20.0) as there wasn’t a zipalign anywhere in the sdk folders, then moving as suggested worked fine.

2 Likes

I just did a fresh install of 4.5.1 on a new computer and added the JDK and Android SDK. I needed to do this in order to get it to build an apk. Thanks guys!

why don’t i have the zipalign.exe in the build-tools/version? i searched with the search function, but i don’t find it >.<

edit: i just did a fresh download, now i have it =)

1 Like

Which version did you download? did you have to copy the zipalign.exe or it just worked?

I think latest version of the Android SDK moved this tool to another folder (as stated above). I opened a bug about it.

1 Like

See bug reported here: http://fogbugz.unity3d.com/default.asp?616836_ktt4nn6jh91dds23

They advise to not upgrade to SDK level 23.

1 Like

Also there is some of problems that there need to have a zipalign.exe from sdk\build-tools folder to past it in tools folder that helped for me

yah I have this error too and i just downloaded the zipalign.exe in this site

http://forum.xda-developers.com/showthread.php?t=1385846

extract the file and copy the files inside Resources to
C:\Development Tools\adt-bundle-windows-x86_64-20140624\sdk\tools
or wherever you put yout adt-bundle

1 Like

This is a bug and it should be fixed in an upcoming Unity patch.

Update - Unity already released a patch that fixes this: Unity Patch Releases - Industries - News & General Discussion - Unity Discussions (4.5.1 p4)

1 Like

I have the newest version and needed to do this any ways.

Thanks for the posts guys.

mmm…I’m still getting the error with 4.5.2 and with the latest Android SDK:

Error building Player: Win32Exception: ApplicationName=‘/Users/Robin/Development/AndroidSDK/sdk/tools/zipalign’, CommandLine=‘4 “/Users/Robin/Desktop/MyGameAndroid/Temp/StagingArea/Package_unaligned.apk” “/Users/Robin/Desktop/MyGameAndroid/Temp/StagingArea/Package.apk”’, CurrentDirectory=‘Temp/StagingArea’

any idea? I’m using Mac.

It happened because google had moved zipalign.exe from tools folder to build-tools folder. Just copy zipalign.exe to “tools” folder and everything should work!

on Mac there’s no zipalign.exe file. I updated Unity to 4.5.2 but I still had the problem afterwords. What I did then is to re-download Android SDK form the website and override the sdk folders, then it worked so the automatic update of Android was messing up something at least on Mac.

Thank you very much, it worked.

1 Like

Thanks so much…! :slight_smile: Saved my day…

You are my hero. I was one second away from bashing my laptop on the floor. After 3 days I finally found a answer. Thanks!