Search Unity

Unity 2017 Broken Batchmode

Discussion in 'Scripting' started by GammaPs, Jul 20, 2017.

  1. GammaPs

    GammaPs

    Joined:
    May 21, 2013
    Posts:
    9
    I have a project that handles a lot of asset bundles and some variations in target platforms.
    Till now the project was running in unity 5.4.4 so it became time to upgrade. And I'm trying to upgrade to unity 2017.1.0

    All AssetBundles and Player builds are build in a static function that can either be triggered from a menu button in Unity or over command line.

    Code is similar to below, just writing some compilationflags enabled disabled levels etc between each platform switch:

    Code (csharp):
    1.  
    2. static BuildTarget[] platforms = new BuildTarget[] { BuildTarget.Android, BuildTarget.iOS, BuildTarget.tvOS };
    3.  
    4. public static void BuildForPlatforms()
    5. {
    6.     foreach(var p in platforms)
    7.     {
    8.          EditorUserBuildSettings.SwitchActiveBuildTarget (p);
    9.          //Write some configurtations to Build
    10.          ....
    11.          BuildPipeline.BuildPlayer(scenes.ToArray(), buildPath, p, options);
    12.     }
    13. }
    14.  
    15. public static void BuildAssetBundles()
    16. {
    17.     foreach(var p in platforms)
    18.     {
    19.         EditorUserBuildSettings.SwitchActiveBuildTarget (p);
    20.         //Write some configurtations to Build
    21.          ....
    22.         BuildPipeline.BuildAssetBundles("mypath", assets, BuildAssetBundleOptions.None, this.activeBuildTarget);
    23.     }
    24. }
    25.  
    Now with Unity 2017 I get multiple issues when Build is triggered over commandline.

    A Warning First:
    2017-07-20 14:42:48.518 Unity[19745:6360587] NSDocumentController Info.plist warning: The values of CFBundleTypeRole entries must be 'Editor', 'Viewer', 'None', or 'Shell'.

    Then multiple issues with Builds and AssetBundles:
    - Android and iOS AssetBundles are not iOS or Android but are marked with BuildTarget 2 that is OSX
    - Exported Players have issues with levels: '/var/containers/Bundle/Application/D0A90E0C-EF4A-4014-B7E7-E3F311FAADC5/dgu.app/Data/level1' is corrupted! Remove it and launch unity again!

    Has anyone made experiances with batchmode run stuff or BuildPipeline behaving wrongly or heavily different in Unity 2017 and has an idea whats breaking?

    Edit: It seams like EditorUserBuildSettings.SwitchActiveBuildTarget (p) or PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup, symbols)
    Or any of the settings is a nonblocking task, meaning the build is crippled because some old crap gets applied later.
     
    Last edited: Jul 20, 2017
  2. Pavel-Kivalin

    Pavel-Kivalin

    Joined:
    Mar 12, 2013
    Posts:
    1
    Hi, we have same issue. Did you find a solution?