- Home /
Command line build fails after updating to Unity 2019.4
I am trying to upgrade a project from Unity 2019.1.13f1 to 2019.4.4f1 and it seems to have gone smoothly when testing in the editor, however, it does not work when I try to build it from the command-line due to missing assembly references. Compiling through command-line is necessary for this project. It needs to build for iOS and Android.
To setup the build, a script is called from the command line as follows:
./buildLoader.sh -t IOS
The script is building the project with the following arguments.
"$UNITY_2019_4_PATH"/Contents/MacOS/Unity \
-batchmode \
-quit \
-nographics \
-logFile - \
-silent-crashes \
-stackTraceLogType Full \
-disable-assembly-updater \
-noUpm \
-buildTarget "$BUILD_TARGET" \
-projectPath "$(pwd)" \
-executeMethod BuildLoader"$BUILD_TARGET".init || exit 1
After the commands execute it outputs the log to the console but ends with the line
error: attach failed: Error 1
The source of the error seems to be that it is missing an assembly reference for a few of the assemblies. One series of errors is related to UnityEngine.UI
error CS0234: The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
Another is related to references in Zenject
Assets/Zenject/OptionalExtras/TestFramework/SceneTestFixture.cs(5,7): error CS0246: The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
The project is separated into several assembly definitions, but there were no issues with the .asmdef files previously and the project does work in the editor. I even tried adding a reference to UnityEngine.UI directly into the Assembly Definition References section but this did not do anything.
I've looked around online for answers to similar problems but none of them resolved the issue here. Has anyone run into similar problems when trying to build from command-line or after updating?
Answer by justingold · Aug 04, 2020 at 12:34 PM
The solution to this problem ended up being to remove the -noUpm
command-line argument from the build script.