I've noticed a few other forum threads with similar errors but none of those resolutions have worked for me. For some reason, Unity is failing every time I try to build this project to Android while packaging the videos in StreamingAssets. There's no other content in StreamingAssets except these videos, other projects build fine to Android, and this project works fine built to PC and running in Editor Preview. I've tried reinstalling the SDK and JDK and downgrading to SDK24 and that didn't work. I've made sure there's no read-only permissions set on the folder or anything. Does anyone have any ideas? I've deleted all extraneous/unused assets from the project as well so it shouldn't be a size issue.
CommandInvokationFailure: Android Asset Packaging Tool failed.
C:\Users\Adrian\AppData\Local\Android\sdk\build-tools\25.0.2\aapt.exe package -v -f -F raw.ap_ -A raw -0 "" --ignore-assets "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
Unable to add 'raw\video2.mp4': Zip add failed (-2147483648)
ERROR: unable to process assets while packaging 'raw.ap_'
ERROR: packaging of 'raw.ap_' failed
Found 8 custom asset files in raw
Src: () raw\video.mp4
Src: () raw\video2.mp4
Src: () raw\video3.mp4
Src: () raw\video4.mp4
Src: () raw\video5.mp4
Src: () raw\video6.mp4
Src: () raw\video7.mp4
Src: () raw\video8.mp4
Writing all files...
'assets/video5.mp4' (not compressed)
Removing raw.ap_ due to earlier failures
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.PostProcessor.Tasks.TasksCommon.Exec (System.String command, System.String args, System.String workingdir, System.String errorMsg, Int32 retiresOnFailure)
I tried moving only the assets used by the build into a new project, as well as the scene, and then building that. Same error.
Answer by liortal
Jan 11 at 09:37 PM
See my answer on this forum post: https://forum.unity3d.com/threads/cannot-build-to-android-commandinvokationfailure-android-asset-packaging-tool-failed.450447/#post-2916612
It seems that the video file (assets/video5.mp4) is too large, which is the reason for the build to fail.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
5 People are following this question.
Streaming Video Player - Android
Android Export issues, in Unit prefenrences is no sdk path
Failed to re-package resources even I make blank project
Как настроить путь к Android SDK
Simple Movie Player or Handheld.PlayFullScreenMovie for Android in unity is not working.