Search Unity

Did 5.3 break Android batch mode ?

Discussion in 'Android' started by jerome-lacoste, Apr 18, 2016.

  1. jerome-lacoste

    jerome-lacoste

    Joined:
    Jan 7, 2012
    Posts:
    206
    We're running automated builds using on a Mac using


    "/Applications/Unity XXXX/Unity.app/Contents/MacOS/Unity" -projectPath /the/path -logFile /the/path/unity3d_editor.log -quit -batchmode -executeMethod XXXX.PerformAndroidBuild

    This works on most projects except with a new job configured to run with 5.3.4f1. That job keeps failing with the following errors:

    I've tried quite a few things:

    * Force the Android SDK location using:

    /usr/libexec/PlistBuddy -c "Add :AndroidSdkRoot string '/Applications/android-sdk-macosx'" ~/Library/Preferences/com.unity3d.UnityEditor5.x.plist

    (before or during the build!)

    * manually open unity, edit preferences, and set the AndroidSdkRoot
    Screen Shot 2016-04-18 at 16.42.39.png

    Yet at some point during the build, the setting is lost.

    ( Note that the user isn't logged in on the account and IL2CPP isn't enabled )

    I noticed the following in the 5.3.4f1 release notes
    • Android: Buildpipe - don't open file dialogs when in batch mode
    • Android: Buildpipe - Fixed an issue where projects created on Mac wouldn't build on Windows
    • Android: Buildpipe - Fixed an issue where the Editor would hang if in batch mode without SDK, NDK and JDK properly configured
    but nothing related in the 5.3.4 patch releases.

    The fact that the editor log contains "This should not be called in batch mode." is a bit strange. I couldn't find other reference to that phrase on the web.

    Bug ?

    In the meantime I'll troubleshoot further.
     
  2. jerome-lacoste

    jerome-lacoste

    Joined:
    Jan 7, 2012
    Posts:
    206
    I struggled a bit more:

    on a different computer, with Unity 5.3.4f1 freshly installed.

    * at start, the Unity 5 preferences (~/Library/Preferences/com.unity3d.UnityEditor5.x.plist) is rather empty
    * build from the CLI => build fails
    * build from the GUI after filling the preferences => build passes
    * build from the CLI again => build passes

    back to the build server
    * build from CLI => build fails
    * build from the GUI after filling the preferences => build passes
    * build from the CLI again => build fails

    note that the preferences are basically reset (at Editor startup it seems)

    Code (CSharp):
    1. $ /usr/libexec/PlistBuddy -c "Print" ~/Library/Preferences/com.unity3d.UnityEditor5.x.plist
    2. Dict {
    3.     GICacheMaximumSizeGB = 10
    4.     RecentlyUsedProjectPaths-3 = /Users/Shared/Jenkins/Home/jobs/game_treasure-master_iOS/workspace
    5.     GA_COOKIE = c1cd506a3675149xxxxxxxxxxxxxxxx
    6.     GICacheCompressionLevel = 1
    7.     RecentlyUsedProjectPaths-7 = /Users/Shared/Unity/4-0_AngryBots
    8.     Editor.kEditorLocale = en
    9.     RecentlyUsedProjectPaths-6 = /Users/Shared/Jenkins/Home/jobs/game_addtetris-master_iOS/workspace
    10.     kWorkspacePath = /Users/Shared/Jenkins/Home/jobs/proto_QuizWWTK_android
    11.     RecentlyUsedProjectPaths-2 = /Users/Shared/Jenkins/Home/jobs/proto_QuizWWTK_iOS/workspace
    12.     kAutoRefresh = 1
    13.     LSValue = -1411324300
    14.     RecentlyUsedProjectPaths-5 = /Users/Shared/Jenkins/Home/jobs/game_DragonBoxPlus-master_webgl/workspace
    15.     RecentlyUsedProjectPaths-1 = /Users/Shared/Jenkins/Home/jobs/game_addtetris-master_u5_iOS/workspace
    16.     LastOpenedScene = Assets/AngryBots.unity
    17.     kProjectBasePath = /Users/Shared/Jenkins/Home/jobs/proto_QuizWWTK_android/workspace
    18.     SpritePackerCacheMaximumSizeGB = 10
    19.     RecentlyUsedProjectPaths-4 = /Users/Shared/Jenkins/Home/jobs/game_DragonBoxPlus-1.x_webgl/workspace
    20.     RecentlyUsedProjectPaths-0 = /Users/Shared/Jenkins/Home/jobs/proto_QuizWWTK_android/workspace
    21. }
    22.  
     
  3. jerome-lacoste

    jerome-lacoste

    Joined:
    Jan 7, 2012
    Posts:
    206
    We worked around this by injecting the AndroidSdkPath in the EditorPrefs at build time. Not really sure what caused it.
     
    CasualT_Bossfight likes this.
  4. leemin

    leemin

    Joined:
    Oct 29, 2014
    Posts:
    3
    I get the same problem at Unity 2017 1.0f3.
    Build In editor is work fine.
    But Shell script always failed
    How did you solve this question finily?