Up until fairly recently (I can’t pinpoint the exact moment), Android builds were significantly faster for me to do than iOS builds, which tended to take a lot of extra time to build because of the Xcode steps.
I’m using Unity 5.3.4 for a medium-sized project (final app binary is ~600MB). I’ve noticed that now, my Android builds take significantly longer than iOS builds - the trend has completely flipped!
I’d estimate that now, my iOS builds have about 10 minutes of turnaround, whereas my Android builds take up to 30 minutes to complete. Looking at the build progress bar, I see that Android gets to a “Building Assets” step, and then hangs out there for a long time. It isn’t frozen, but it seems to be building a ton of assets!
Anyway, I was wondering if anyone else had noticed something similar. Is the change the result of updates to the way Unity creates Android builds? Is there anything I can do to speed it up? Does this behavior seem buggy, or expected?
Don’t know if it provides any insight, but the console output during the “Building Assets” portion of the build is pages and pages of this:
I don’t know if it’s performing an expensive operation for every single asset in the game, or what. Again, maybe this is how the builds are supposed to function for Android, but if that’s the case, I really hope I don’t have to spend time in the future manually making Android builds!
I have the same issue and have yet to find a solution. I feel like the change occurred around the time we upgraded to 5.1 or 5.2. Did you happen to upgrade Unity around the time your build slowed down? Or maybe you’ve added some third party library? I’ve gone through my project and tried stripping out Asset post processors and other such things to no avail. :-/
To follow up on this - I made a new project and copied only my resources (~200MB) over to the new project. The build process still spends a long time updating each asset. Seems like it is running a GC between each?
We did upgrade to 5.3.4 from 5.2.2 probably about a month ago. I may only be noticing the change now because we usually have a build machine that does builds on our behalf. But over the past week, I’ve had to create a lot of builds at my desk to test a device-only feature, which has really been a slog :-\
After waiting 20-30 minutes for an Android build to cook, Unity will spit out an error about one of the assets being invalid, and then I’ll have to restart the build and hope it doesn’t happen again. Pretty frustrating!
Yep, or worse, the build was fine, but it had problems installing on the device because of a version conflict or something else correctable. Because of this bug, I have become conditioned to never do “Build and Run” and instead use adb to install.
fwiw, we were able to reduce our Android build times somewhat by removing a third party library - Full Inspector (Full Inspector: Inspect Everything | Tools | Unity Asset Store). The build times are still longer than they used to be and the odd lengthy logs mentioned above still remain.
Looks like for me the cause of the issue issue is having data in the Assets/Resources folder. This seems to trigger thebuilding of all the textures/assets when it comes to doing an Android build.