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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Android build taking 5-10 minutes to build gradle project

Discussion in 'Android' started by swedishfisk, Aug 27, 2019.

  1. swedishfisk

    swedishfisk

    Joined:
    Oct 14, 2016
    Posts:
    57
    A small project with 2 scenes get to the "building gradle project" in about 1 minute, then the gradle project build part takes upwards of 10 minutes on 2019.1.12. Is this normal?
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,679
    Most likely not, try exporting a project instead of building it from Unity, then import it in Android Studio, and build from there. See if you have the same issue there.
     
  3. Askewkea08

    Askewkea08

    Joined:
    Apr 19, 2023
    Posts:
    1
    For me when I did it, I have a small vr game that regularly takes up to 3 - 4 minutes to build, last night, it took 5 hours and didn’t even finish. I had to force quit
     
  4. Boketter

    Boketter

    Joined:
    Jul 8, 2021
    Posts:
    3
    Not sure if this is the right place to post, but I've also started having similar issues. I'm working on an application that is being built for both iOS and Android.

    It's been running on an Intel Macbook Pro, 2021.3.11f1 for a while now and even though that's fine for the most part, it sometimes ends up in an infinite load in the editor, forcing me to close and reopen it completely.

    However, when I tried to update to 2021.3.20f1 or 2021.3.23f1, even though iOS builds continued to work fine, Android builds suddenly started getting lots of issues.

    The first is that it's suddenly incapable of replacing assetbundles (.aab).

    Moving final Android package(s) failed
    Can't remove non-empty directory '/Path/aabBuild.aab'.

    However, if I manually delete the old build, it either takes much longer than usual to create a build for the first time, or gets stuck in the post process gradle part.

    After a few restarts it starts to perform considerably faster and better, being able to finish builds in 30-60 seconds, but having to manually delete the aab file manually seems to persist.