Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Android App Bundle (.aab) FileNotFoundException Error when trying to build

Discussion in 'Android' started by Dillicon, Apr 24, 2022.

  1. Dillicon

    Dillicon

    Joined:
    Feb 3, 2021
    Posts:
    4
    When ever I try to build my game I get a FileNotFoundException, I even tried an empty project but it still didn't work. Here is the full error message.

    FileNotFoundException: Temp\gradleOut\launcher\build\outputs\bundle\release\launcher-release.aab does not exist
    System.IO.File.Move (System.String sourceFileName, System.String destFileName) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <015079d9a4ea4f97b4381e694d2310c1>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,335
    What Unity version are you using? Try updating to latest LTS
     
  3. Dillicon

    Dillicon

    Joined:
    Feb 3, 2021
    Posts:
    4
    I am currently using 2020.3.8f1, I'll try to update in a bit
     
  4. Dillicon

    Dillicon

    Joined:
    Feb 3, 2021
    Posts:
    4
    Now when I build to em.aab I get this

    FileNotFoundException: Could not find file 'D:\UnityGames\Demo Android Game\Builds\em.aab'.
    System.IO.FileInfo.get_Length () (at <6073cf49ed704e958b8a66d540dea948>:0)
    UnityEditor.Android.PostProcessor.Tasks.CheckApksSize.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <cef18509d2a64c60b8ff238a98d49698>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <cef18509d2a64c60b8ff238a98d49698>:0)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at <cef18509d2a64c60b8ff238a98d49698>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <cef18509d2a64c60b8ff238a98d49698>:0)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <1135c66e5f4c41a7831fa5798849d8b6>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,335
    Do you by chance have gradle templates set ? If so, maybe they're missing pieces to build aab.
     
  6. Dillicon

    Dillicon

    Joined:
    Feb 3, 2021
    Posts:
    4
    Thank you it turned out that I had 3 gradle templates from when i was trying to fix it before. Thank you!
     
  7. strikeric11

    strikeric11

    Joined:
    Sep 7, 2016
    Posts:
    10
    Hi I have the same problem with you. How did you solve your problem? What do you mean by 3 gradle templates?
     
  8. yahodovaniuk

    yahodovaniuk

    Joined:
    Apr 19, 2022
    Posts:
    2
    Dude you need to go in Player Settings->Player->Publishing settings->gradle templates upload_2022-10-29_18-20-14.png