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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Bug Unity Cloud Build taking much longer for Android vs iOS

Discussion in 'Unity Build Automation' started by philyum, Feb 10, 2023.

  1. philyum

    philyum

    Joined:
    Dec 16, 2013
    Posts:
    12
    iOS builds: ~20mins
    Android builds: ~1hr 20mins

    They used to take around the same time to complete, but have increased by 1hr since a couple months ago.

    I also noticed that the "Start Importing..." phase takes around 40mins for Android but only around 5mins for iOS.

    Please advise thanks.
     
    Tommy-Angelo likes this.
  2. philyum

    philyum

    Joined:
    Dec 16, 2013
    Posts:
    12
  3. Benjamin-Gooding

    Benjamin-Gooding

    Unity Technologies

    Joined:
    Apr 12, 2022
    Posts:
    243
    What is the builder operating system for each build target? Are you running clean builds?
     
  4. philyum

    philyum

    Joined:
    Dec 16, 2013
    Posts:
    12
    Hi!

    For building OS I'm using Windows for Android and Mac for iOS.

    Clean / Non-Clean builds seem to take the same time
     
  5. Benjamin-Gooding

    Benjamin-Gooding

    Unity Technologies

    Joined:
    Apr 12, 2022
    Posts:
    243
    In the full logs, you should see a line about downloading the cache on Windows. If you see a message along the lines of no cache found then each build is basically being treated like a "clean build" because the Library cache is getting created on each build.

    Our windows builders are also not as performant as the Mac builders at this point in time. Switching your Android builds to Mac should improve the build times.
     
  6. philyum

    philyum

    Joined:
    Dec 16, 2013
    Posts:
    12
    Seems the assets already already cached and loaded, but it's 2gb, is that normal? On iOS it's already 700mb.

    [2023-02-27T14:06:49.135Z] - 7.2.7.2.7.4 - INFO: ++++++++++++++++++++ SECTION ++++++++++++++++++++
    [2023-02-27T14:06:49.135Z] - 7.2.7.2.7.4 - INFO: + Fetch Cached Library
    [2023-02-27T14:06:49.135Z] - 7.2.7.2.7.4 - INFO: ++++++++++++++++++++ SECTION ++++++++++++++++++++
    [2023-02-27T14:07:01.842Z] - 7.2.7.2.7.4 - INFO: Download of cache file library_2021_3_13f1_windows finished, size is 2253683790 bytes
    [2023-02-27T14:07:01.842Z] - 7.2.7.2.7.4 - INFO: Extracting cache files to BUILD_PATH/p
    [2023-02-27T14:09:48.112Z] - 7.2.7.2.7.4 - INFO: library successfully restored from remote cache


    If I try to build with Mac OS, it fails with this error

    [error] [2023-02-28T05:33:29Z - Unity] ERROR: Loading package information...
    [error] [2023-02-28T05:33:29Z - Unity] ERROR: Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    [warning] [2023-02-28T05:33:29Z - Unity] Warning: Failed to read or create install properties file.
    [warning] [2023-02-28T05:33:29Z - Unity] Warning: Failed to read or create install properties file.
    [warning] [2023-02-28T05:33:29Z - Unity] Warning: Failed to read or create install properties file.
    [warning] [2023-02-28T05:33:29Z - Unity] Warning: Failed to read or create install properties file.
    [error] [2023-02-28T05:33:29Z - Unity] at UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) [0x00033] in <b8958c706cdd4a7fa97745ad82493d62>:0
    [error] [2023-02-28T05:33:29Z - Unity] at UnityEditor.Android.Command.RunWithStdin (System.Diagnostics.ProcessStartInfo psi, System.String errorMsg, System.Collections.Generic.IEnumerable`1[T] input) [0x00078] in <b8958c706cdd4a7fa97745ad82493d62>:0
    [warning] [2023-02-28T05:33:29Z - Unity] at UnityEditor.Android.AndroidSDKTools.RunAndroidSdkTool (System.String toolName, System.String arguments, System.Boolean updateCommand, System.String errorMsg, System.String toolsDir, System.String[] warningsToIgnore) [0x0007b] in <b8958c706cdd4a7fa97745ad82493d62>:0
    [error] [2023-02-28T05:33:29Z - Unity] at UnityEditor.Android.AndroidSDKTools.RunAndroidSdkTool (System.String toolName, System.String arguments, System.Boolean updateCommand, System.String errorMsg) [0x00001] in <b8958c706cdd4a7fa97745ad82493d62>:0
    [error] [2023-02-28T05:33:29Z - Unity] ERROR: Player export failed. Reason: Building Player failed
    [error] [2023-02-28T05:33:59Z - Unity] [Performance] InitializeOnLoad EntitlementsErrorChecker.OpenFirstEntitlementError : 2 samples, Peak. 399 us (1.6x), Avg. 250 us, Total. 501.0 us (0.0%)
    [warning] [2023-02-28T05:33:59.262Z] - 7.2.7.2.4.2 - WARN: Running Unity in Batch Mode can help reproduce and debug potential build/test issues.
    [warning] [2023-02-28T05:33:59.262Z] - 7.2.7.2.4.2 - WARN: For additional information on building in Batch Mode see https://support.unity.com/hc/en-us/articles/9466056266004-How-do-I-Build-Unity-Project-in-Batchmode-Locally-
    [warning] [2023-02-28T05:33:59.262Z] - 7.2.7.2.4.2 - WARN: Try running Unity 2021.3.13f1 in batch mode locally with the following commands:
    [warning] [2023-02-28T05:33:59.262Z] - 7.2.7.2.4.2 - WARN: When running from Windows:
    [warning] [2023-02-28T05:33:59.262Z] - 7.2.7.2.4.2 - WARN: "C:\Program Files\Unity\Hub\Editor\2021.3.13f1\Editor\Unity.exe" -logFile {PATH_TO_LOG_FILE} -projectPath {PROJECT_PATH} -batchmode -skipMissingProjectID -skipMissingUPID -buildTarget android --quit -executeMethod {CLASS_AND_STATIC_METHOD_NAME_OF_BUILD_SCRIPT} -quit
    [warning] [2023-02-28T05:33:59.262Z] - 7.2.7.2.4.2 - WARN: When running from Mac:
    [warning] [2023-02-28T05:33:59.262Z] - 7.2.7.2.4.2 - WARN: /APPLICATION_PATH/Unity/Hub/Editor/2021.3.13f1/Unity.app/Contents/MacOS/Unity -logFile {PATH_TO_LOG_FILE} -projectPath {PROJECT_PATH} -batchmode -skipMissingProjectID -skipMissingUPID -buildTarget android --quit -executeMethod {CLASS_AND_STATIC_METHOD_NAME_OF_BUILD_SCRIPT} -quit
    [error] [2023-02-28T05:33:59.262Z] - 7.2.7.2.4.2 - FATAL: ! Unity player export failed!
    [error] Finished: FAILURE
     
  7. Benjamin-Gooding

    Benjamin-Gooding

    Unity Technologies

    Joined:
    Apr 12, 2022
    Posts:
    243
    We expect the library cache size to be different between target platforms. I'm not sure why the build is failing on Mac, at this point, if you want to switch to building on mac for your Android project, I'd suggest opening up a support ticket so we can have someone take a deeper look into the issue.

    In regards to the builds on Windows taking longer, that isn't outside of the norm. The machine specs on Windows are not nearly as high as though on Mac.
     
  8. philyum

    philyum

    Joined:
    Dec 16, 2013
    Posts:
    12
    I'm still getting 1.5hr builds.
    I'm comparing the build log to 4months ago when they were still sub 30mins.
    I noticed the Asset Pipeline Refresh is taking about 1 hour now, vs a few minutes previously.
    Please advise, thanks!

    NOW:

    [2023-03-31T17:39:04Z - Unity] Asset Pipeline Refresh: Total: 3727.323 seconds - Initiated by InitialRefreshV2(ForceSynchronousImport)
    [2023-03-31T17:39:04Z - Unity] Summary:
    [2023-03-31T17:39:04Z - Unity] Imports: total=3913 (actual=3913, local cache=0, cache server=0)
    [2023-03-31T17:39:04Z - Unity] Asset DB Process Time: managed=1198 ms, native=3595965 ms
    [2023-03-31T17:39:04Z - Unity] Asset DB Callback time: managed=35134 ms, native=1540 ms
    [2023-03-31T17:39:04Z - Unity] Scripting: domain reloads=1, domain reload time=19111 ms, compile time=44108 ms, other=30259 ms
    [2023-03-31T17:39:04Z - Unity] Project Asset Count: scripts=5313, non-scripts=8685
    [2023-03-31T17:39:04Z - Unity] Asset File Changes: new=3899, changed=3916, moved=0, deleted=4
    [2023-03-31T17:39:04Z - Unity] Scan Filter Count: 0


    PREVIOUS:

    [2022-12-15T12:42:09Z - Unity] Asset Pipeline Refresh: Total: 207.854 seconds - Initiated by InitialRefreshV2(ForceSynchronousImport)
    [2022-12-15T12:42:09Z - Unity] Summary:
    [2022-12-15T12:42:09Z - Unity] Imports: total=36 (actual=36, local cache=0, cache server=0)
    [2022-12-15T12:42:09Z - Unity] Asset DB Process Time: managed=45 ms, native=137740 ms
    [2022-12-15T12:42:09Z - Unity] Asset DB Callback time: managed=344 ms, native=943 ms
    [2022-12-15T12:42:09Z - Unity] Scripting: domain reloads=1, domain reload time=15299 ms, compile time=27993 ms, other=25486 ms
    [2022-12-15T12:42:09Z - Unity] Project Asset Count: scripts=5076, non-scripts=8421
    [2022-12-15T12:42:09Z - Unity] Asset File Changes: new=22, changed=39, moved=0, deleted=5
    [2022-12-15T12:42:09Z - Unity] Scan Filter Count: 0
     

    Attached Files:

  9. Benjamin-Gooding

    Benjamin-Gooding

    Unity Technologies

    Joined:
    Apr 12, 2022
    Posts:
    243
    The number of assets being imported is much higher now than it was before. Are all of the .meta files present in your repo for the assets? In your project setting for Build Automation, is your cache set to Library or none? If it is set to none then it will have to re-import the assets to build the Library