CommandInvokationFailure: Failed to align APK package.

Someone could help me with this problem?
Im making an android game with unity and i finished it but i cant build it.
It appear this: CommandInvokationFailure: Failed to align APK package.

I Moved a file from build tools to tools in sdk, I didnt forget to add keystore file to developer settings. I tried to see similar answers but no one helped me. The question hasnt been asked several time before and there aren`t existing answers available that can be found through a search.

C:\Users\Stefano Tonola\AppData\Local\Android\Sdk\build-tools\25.0.3\zipalign.exe 4
“D:\Programmi x86\Unity\FlappyDiBonito2\Temp/StagingArea/Package_unaligned.apk”
“D:\Programmi x86\Unity\FlappyDiBonito2\Temp/StagingArea/Package.apk”

1)download android IDE android-studio-ide-162.3871768-windows from https://developer.android.com/studio/index.html

2)open the IDE and got to settings and click on appearance and Beauvoir and then click on System settings and then click ok android sdk

3)As your sdk tools version is old it might cause the error so

  1. select android sdk tools 25.0.5 and 25.0.3 i.e update it or install , also go to sdk platform tab and install updated android SDK platform which you are using or you can download the latest like nugget latest if you want one .

If the problem is with SDK platform delete old one and reinstall new one

sdk platform tab

5)now build and see the result whether error removed or not if not processed to 5 step

SDK tools tab


6) if same error occurs then go Android SDK Offline: Android SDK Tools/Manager and download the 25.03 but latest is preferred 25.2.5 and extract it and copy the extracted tool folder and paste it in your sdk and you sdk path is C:\Users\Stefano Tonola\AppData\Local\Android\Sdk

I have read that you need to use KItKat as the SDK platform as it works best with cardboard.
I’m not sure if this will solve the problem but it might be one of the errors.

I got this error after I had built successfully many times without any problems. Turns out, the solution was restarting Unity :confused: