Search Unity

Cannot build to Android: CommandInvokationFailure: Android Asset Packaging Tool failed.

Discussion in 'Android' started by ajhatch, Jan 10, 2017.

  1. ajhatch

    ajhatch

    Joined:
    Oct 21, 2016
    Posts:
    7
    Hello,

    I've noticed a few other forum/answers 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 while packaging StreamingAssets. There's no other content in StreamingAssets except the videos listed in the error message, 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. I've deleted all extraneous/unused assets from the project, and I also tried creating a new project and importing only the scene and assets I need, that build also fails. Does anyone have any ideas?

    Thanks


    Error message:

    Code (CSharp):
    1.  CommandInvokationFailure: Android Asset Packaging Tool failed.
    2.      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:!*~"
    3. stderr[
    4.        Unable to add 'raw\video2.mp4': Zip add failed (-2147483648)
    5. ERROR: unable to process assets while packaging 'raw.ap_'
    6. ERROR: packaging of 'raw.ap_' failed
    7. ]
    8. stdout[
    9. Found 8 custom asset files in raw
    10. Configurations:
    11.   (default)
    12. Files:
    13.    assets\video.mp4
    14.      Src: () raw\video.mp4
    15.    assets\video2.mp4
    16.      Src: () raw\video2.mp4
    17.    assets\video3.mp4
    18.      Src: () raw\video3.mp4
    19.    assets\video4.mp4
    20.      Src: () raw\video4.mp4
    21.    assets\video5.mp4
    22.      Src: () raw\video5.mp4
    23.    assets\video6.mp4
    24.      Src: () raw\video6.mp4
    25.    assets\video7.mp4
    26.      Src: () raw\video7.mp4
    27.    assets\video8.mp4
    28.      Src: () raw\video8.mp4
    29. Resource Dirs:
    30. Creating 'raw.ap_'
    31. Writing all files...
    32.        'assets/video5.mp4' (not compressed)
    33. Removing raw.ap_ due to earlier failures
    34. ]
    35. UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    36. UnityEditor.Android.PostProcessor.Tasks.TasksCommon.Exec (System.String command, System.String args, System.String workingdir, System.String errorMsg, Int32 retiresOnFailure)
    37. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    What is the size of video5.mp4 ?
     
  3. ajhatch

    ajhatch

    Joined:
    Oct 21, 2016
    Posts:
    7
    I was positive the videos couldn't be oversized since they're all low resolution and I thought our editor had trimmed them down, but it turns out one was 52 minutes long and 3.90 GB! I'll give that a try.

    Edit: In case others have this issue and locate this forum post, I can confirm the issue was oversized assets.
     
    Last edited: Jan 11, 2017
    Alan-Hart and liortal like this.
  4. jakeyade

    jakeyade

    Joined:
    Oct 17, 2018
    Posts:
    2
    I know this post is pretty old but it seems I may be having the same problem. All the files on this list are between 2 MB - 2.91MB. But it seems that none of the files are compressing. Are the files just too large?

    Code (CSharp):
    1. CommandInvokationFailure: Android Asset Packaging Tool failed.
    2. C:\Users\jacob\AppData\Local\Android\sdk\build-tools\27.0.3\aapt.exe package -v -f -F rawobb.ap_ -A rawobb -0 "" --ignore-assets "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    3.  
    4. stderr[
    5.       Unable to add 'rawobb\12-2-5_1.mp4': Zip add failed (-2147483648)
    6. ERROR: unable to process assets while packaging 'rawobb.ap_'
    7. ERROR: packaging of 'rawobb.ap_' failed
    8. ]
    9. stdout[
    10. Found 15 custom asset files in rawobb
    11. Configurations:
    12. (default)
    13.  
    14. Files:
    15.   assets\12-1-1_1.mp4
    16.     Src: () rawobb\12-1-1_1.mp4
    17.   assets\12-1-2_1.mp4
    18.     Src: () rawobb\12-1-2_1.mp4
    19.   assets\12-1-3_1.mp4
    20.     Src: () rawobb\12-1-3_1.mp4
    21.   assets\12-1-4_1.mp4
    22.     Src: () rawobb\12-1-4_1.mp4
    23.   assets\12-1-5_1.mp4
    24.     Src: () rawobb\12-1-5_1.mp4
    25.   assets\12-2-1_1.mp4
    26.     Src: () rawobb\12-2-1_1.mp4
    27.   assets\12-2-2_1.mp4
    28.     Src: () rawobb\12-2-2_1.mp4
    29.   assets\12-2-3_1.mp4
    30.     Src: () rawobb\12-2-3_1.mp4
    31.   assets\12-2-4_1.mp4
    32.     Src: () rawobb\12-2-4_1.mp4
    33.   assets\12-2-5_1.mp4
    34.     Src: () rawobb\12-2-5_1.mp4
    35.   assets\12-3-1_1.mp4
    36.     Src: () rawobb\12-3-1_1.mp4
    37.   assets\12-3-2_1.mp4
    38.     Src: () rawobb\12-3-2_1.mp4
    39.   assets\12-3-3_1.mp4
    40.     Src: () rawobb\12-3-3_1.mp4
    41.   assets\12-3-4_1.mp4
    42.     Src: () rawobb\12-3-4_1.mp4
    43.   assets\12-3-5_1.mp4
    44.     Src: () rawobb\12-3-5_1.mp4
    45.  
    46. Resource Dirs:
    47. Creating 'rawobb.ap_'
    48. Writing all files...
    49.       'assets/12-1-1_1.mp4' (not compressed)
    50.       'assets/12-1-2_1.mp4' (not compressed)
    51.       'assets/12-1-3_1.mp4' (not compressed)
    52.       'assets/12-1-4_1.mp4' (not compressed)
    53.       'assets/12-1-5_1.mp4' (not compressed)
    54.       'assets/12-2-1_1.mp4' (not compressed)
    55.       'assets/12-2-2_1.mp4' (not compressed)
    56.       'assets/12-2-3_1.mp4' (not compressed)
    57.       'assets/12-2-4_1.mp4' (not compressed)
    58. Removing rawobb.ap_ due to earlier failures
    59. ]
    60. exit code: 1
    61. UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    62. UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    63. UnityEditor.Android.PostProcessor.Tasks.TasksCommon.Exec (System.String command, System.String args, System.String workingdir, System.String errorMsg)
    64. UnityEditor.Android.PostProcessor.Tasks.AAPTPackage.AAPTPack (UnityEditor.Android.PostProcessor.PostProcessorContext context, System.String apkName, System.String directory, Boolean compress)
    65. UnityEditor.Android.PostProcessor.Tasks.AAPTPackage.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    66. UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    67. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
     
  5. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    probably also due to large file size.. what is the size of your apk?
     
  6. MiVenTech

    MiVenTech

    Joined:
    May 24, 2019
    Posts:
    2
    update your android SDK tools. update version 26.1.1