Hi, I am Adi, I am from Agate Studio.
We have a problem in our studio setting up a gitlab ci (auto build) for Unity 2017. We’ve setup a runner on a mac machine. Everything was working correctly when we’re using Unity 5.x.x, but since we upgraded some of our projects to Unity 2017.x.x and some to Unity 2018.x.x, we were unable to get the auto build working correctly. Here are the 2 error cases we have noticed:
- Mismatched project path.
Somehow the project being accessed changes from our intended path into another project in another path.
Redacted build log:
[Package Manager] Server::Start -- Port 55828 was selected
COMMAND LINE ARGUMENTS:
/Applications/Unity2017.4.14f1/Unity.app/Contents/MacOS/Unity
-batchmode
-nographics
-quit
-projectPath
/Volumes/DATA/CIBuilds/06a8f348/0/aGin/New Unity Project #actual project path
-logFile
Build.log
-executeMethod
BuildProject.BuildAndroid
/Volumes/DATA/CIBuilds/06a8f348/0/code-bank/ci-cd #this here, it's opening another project in runner machine's disk
Loading GUID <-> Path mappings...0.000055 seconds
Loading Asset Database...0.012733 seconds
Audio: FMOD Profiler initialized on port 54900
AssetDatabase consistency checks...Invalid '.info' file discovered, no metadata file. Will be deleted: 'library/metadata/51/510d1d319d2754ea4a47c6dd8c421ea0.info' and 'library/metadata/51/510d1d319d2754ea4a47c6dd8c421ea0'.resource (if exists).
(Filename: /Users/builduser/buildslave/unity/build/Modules/AssetDatabase/Editor/V1/AssetInterface.cpp Line: 1561)
Invalid '.info' file discovered, no metadata file. Will be deleted: 'library/metadata/bc/bcd27da1c9ae94d2cafe094482a20792.info' and 'library/metadata/bc/bcd27da1c9ae94d2cafe094482a20792'.resource (if exists).
...
'/Applications/Unity2017.4.14f1/Unity.app/Contents/UnityExtensions/Unity/TestRunner/Editor/UnityEditor.TestRunner.dll' GUID: 4113173d5e95493ab8765d7b08371de4
'/Applications/Unity2017.4.14f1/Unity.app/Contents/UnityExtensions/Unity/TestRunner/net35/unity-custom/nunit.framework.dll' GUID: 4b3fa4bde7f1451a8218c03ee6a8ded8
'/Applications/Unity2017.4.14f1/Unity.app/Contents/UnityExtensions/Unity/UIAutomation/Editor/UnityEditor.UIAutomation.dll' GUID: b8a0574e92bd43a59e19d6c3c6ae54c7
'/Applications/Unity2017.4.14f1/Unity.app/Contents/UnityExtensions/Unity/Timeline/Editor/UnityEditor.Timeline.dll' GUID: 7668179ede524d6396c8b7d84461ea29
Unloading 85 Unused Serialized files (Serialized files now loaded: 0)
System memory in use before: 260.3 MB.
System memory in use after: 260.4 MB.
Unloading 29 unused Assets to reduce memory usage. Loaded Objects now: 950.
Total: 8.203597 ms (FindLiveObjects: 0.284429 ms CreateObjectMapping: 0.022645 ms MarkObjects: 7.874292 ms DeleteObjects: 0.020778 ms)
Scripts have compiler errors. #compile error, of course. this particular different project has not been upgraded to Unity 2017 yet.
(Filename: /Users/builduser/buildslave/unity/build/Runtime/Utilities/Argv.cpp Line: 227)
Aborting batchmode due to failure:
Scripts have compiler errors.
[Package Manager] Server::Kill -- Server was shutdown
- Failure to build to target platform.
We have installed needed target platform for the engine version and tested building it manually. But when somehow the editor managed to get project path right, the pipeline is failed with this info in the build log:
[Package Manager] Server::Start -- Port 54260 was selected
COMMAND LINE ARGUMENTS:
/Applications/Unity2017.4.14f1/Unity.app/Contents/MacOS/Unity
-batchmode
-nographics
-quit
-projectPath
/Volumes/DATA/CIBuilds/06a8f348/0/aGin/New Unity Project
-logFile
Build.log
-executeMethod
BuildProject.BuildAndroid
/Volumes/DATA/CIBuilds/06a8f348/0/aGin/New Unity Project #managed to get the project path right
Loading GUID <-> Path mappings...0.000058 seconds
Loading Asset Database...0.009151 seconds
Audio: FMOD Profiler initialized on port 54900
AssetDatabase consistency checks...0.025980 seconds
Refreshing native plugins compatible for Editor in 5.24 ms, found 1 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
DisplayProgressbar: Unity Package Manager
...
Unloading 115 Unused Serialized files (Serialized files now loaded: 0)
System memory in use before: 221.6 MB.
System memory in use after: 221.6 MB.
Unloading 87 unused Assets to reduce memory usage. Loaded Objects now: 849.
Total: 1.134305 ms (FindLiveObjects: 0.207625 ms CreateObjectMapping: 0.025586 ms MarkObjects: 0.878275 ms DeleteObjects: 0.022160 ms)
Switching to Android:AndroidPlayer is disabled
(Filename: Line: -1)
*** Cancelled 'Build.SwitchBuildTargetEmulation.Android.AndroidPlayer' in 0 seconds (0 ms)
Updating ProjectSettings/ProjectSettings.asset - GUID: 00000000000000004000000000000000...
done. [Time: 45.483219 ms]
Refreshing native plugins compatible for Editor in 1.61 ms, found 4 plugins.
Preloading 1 native plugins for Editor in 0.40 ms.
----- Total AssetImport time: 0.141886s, AssetImport time: 0.077551s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]
Error building player because build target was unsupported
(Filename: Line: -1)
Unloading 12 Unused Serialized files (Serialized files now loaded: 0)
System memory in use before: 242.1 MB.
System memory in use after: 242.3 MB.
Unloading 8 unused Assets to reduce memory usage. Loaded Objects now: 2846.
Total: 4.062133 ms (FindLiveObjects: 0.360774 ms CreateObjectMapping: 0.033142 ms MarkObjects: 3.649411 ms DeleteObjects: 0.017632 ms)
Load scene 'Temp/__Backupscenes/0.backup' time: 0.024385 ms
Unloading 0 Unused Serialized files (Serialized files now loaded: 0)
System memory in use before: 241.8 MB.
System memory in use after: 242.1 MB.
Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 2846.
Total: 3.712972 ms (FindLiveObjects: 0.346022 ms CreateObjectMapping: 0.032992 ms MarkObjects: 3.324262 ms DeleteObjects: 0.009009 ms)
*** Cancelled 'Build.Player.AndroidPlayer' in 1 seconds (898 ms)
Batchmode quit successfully invoked - shutting down!
Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.002830 seconds (Nothing changed)
Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.002804 seconds (Nothing changed)
Setting up 2 worker threads for Enlighten.
Thread -> id: 70000d416000 -> priority: 1
Thread -> id: 70000d499000 -> priority: 1
[Package Manager] Server::Kill -- Server was shutdown
Cleanup mono
Exiting batchmode successfully now!
I was hoping there is someone who have better knowledge about CI and accessing Unity’s build pipeline via batchmode can give insight to these problems.
- the gitlab yaml and build script are attached below.
3888817–330667–New Unity Project.zip (69.5 KB)