Error while building Unity3D project for Oculus Quest - Api Updater

My stack:

  • MacOS Catalina 10.15
  • Unity 2020.1

The project runs without problems in the editor but when I try to “Build and Run” on Oculus Quest, the build fails and I get the following error:

APIUpdater encountered some issues and was not able to finish.

However, if I just run “Build” I get the same message but the build doesn’t fail.

This is the detailed log:

Unhandled Exception:
System.InvalidOperationException:
Operation is not valid due to the
current state of the object. at
Mono.Cecil.ModuleDefinition.ReadSymbols
(Mono.Cecil.Cil.ISymbolReader reader)
[0x0002f] in :0 at
Mono.Cecil.ModuleReader.ReadSymbols
(Mono.Cecil.ModuleDefinition module,
Mono.Cecil.ReaderParameters
parameters) [0x0004a] in :0 at
Mono.Cecil.ModuleReader.CreateModule
(Mono.Cecil.PE.Image image,
Mono.Cecil.ReaderParameters
parameters) [0x00081] in :0 at
Mono.Cecil.ModuleDefinition.ReadModule
(Mono.Disposable1[T] stream,
System.String fileName,
Mono.Cecil.ReaderParameters
parameters) [0x0000d] in
:0
at
Mono.Cecil.ModuleDefinition.ReadModule
(System.String fileName,
Mono.Cecil.ReaderParameters
parameters) [0x0006c] in
:0
at
Mono.Cecil.AssemblyDefinition.ReadAssembly
(System.String fileName,
Mono.Cecil.ReaderParameters
parameters) [0x00000] in
:0
at
APIUpdater.Framework.Configuration.ObsoleteAttributeBasedConfigurationFactory…ctor
(System.String pathToAssemblyWithAttr,
System.Boolean
reportSourceInformation,
System.String
potentiallyReferencedAssemblyPaths)
[0x00079] in
<0fe7ec72ecde4a678c1b40d9258cbb9a>:0
at
APIUpdater.Framework.Util.IEnumerableExtensions.ComputeConfigurationProvider
(System.Collections.Generic.IEnumerable1[T]
assemblyPaths,
APIUpdater.Framework.Configuration.ConfigurationProvider
provider, System.String references)
[0x00032] in
<0fe7ec72ecde4a678c1b40d9258cbb9a>:0
at
ScriptUpdater.Program.ConfigurationProviderFor
(APIUpdater.Framework.Configuration.CompilerResponseFile
responseFile,
System.Text.RegularExpressions.Regex
configSourceFilter,
APIUpdater.Framework.Log.ConsoleUpdateListener
logger) [0x000e1] in
<54b90a5c44ee4447be8043569dac3be1>:0
at ScriptUpdater.Program.Main
(System.String args) [0x00099] in
<54b90a5c44ee4447be8043569dac3be1>:0
[ERROR] FATAL UNHANDLED EXCEPTION:
System.InvalidOperationException:
Operation is not valid due to the
current state of the object. at
Mono.Cecil.ModuleDefinition.ReadSymbols
(Mono.Cecil.Cil.ISymbolReader reader)
[0x0002f] in :0 at
Mono.Cecil.ModuleReader.ReadSymbols
(Mono.Cecil.ModuleDefinition module,
Mono.Cecil.ReaderParameters
parameters) [0x0004a] in :0 at
Mono.Cecil.ModuleReader.CreateModule
(Mono.Cecil.PE.Image image,
Mono.Cecil.ReaderParameters
parameters) [0x00081] in :0 at
Mono.Cecil.ModuleDefinition.ReadModule
(Mono.Disposable1[T] stream,
System.String fileName,
Mono.Cecil.ReaderParameters
parameters) [0x0000d] in
:0
at
Mono.Cecil.ModuleDefinition.ReadModule
(System.String fileName,
Mono.Cecil.ReaderParameters
parameters) [0x0006c] in
:0
at
Mono.Cecil.AssemblyDefinition.ReadAssembly
(System.String fileName,
Mono.Cecil.ReaderParameters
parameters) [0x00000] in
:0
at
APIUpdater.Framework.Configuration.ObsoleteAttributeBasedConfigurationFactory…ctor
(System.String pathToAssemblyWithAttr,
System.Boolean
reportSourceInformation,
System.String
potentiallyReferencedAssemblyPaths)
[0x00079] in
<0fe7ec72ecde4a678c1b40d9258cbb9a>:0
at
APIUpdater.Framework.Util.IEnumerableExtensions.ComputeConfigurationProvider
(System.Collections.Generic.IEnumerable1[T]
assemblyPaths,
APIUpdater.Framework.Configuration.ConfigurationProvider
provider, System.String references)
[0x00032] in
<0fe7ec72ecde4a678c1b40d9258cbb9a>:0
at
ScriptUpdater.Program.ConfigurationProviderFor
(APIUpdater.Framework.Configuration.CompilerResponseFile
responseFile,
System.Text.RegularExpressions.Regex
configSourceFilter,
APIUpdater.Framework.Log.ConsoleUpdateListener
logger) [0x000e1] in
<54b90a5c44ee4447be8043569dac3be1>:0
at ScriptUpdater.Program.Main
(System.String args) [0x00099] in
<54b90a5c44ee4447be8043569dac3be1>:0

Build completed with a result of
‘Failed’
UnityEngine.GUIUtility:ProcessEvent(Int32,
IntPtr, Boolean&) (at
/Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

UnityEditor.BuildPlayerWindow+BuildMethodException:
4 errors at
UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer
(UnityEditor.BuildPlayerOptions
options) [0x00270] in
/Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:187
at
UnityEditor.BuildPlayerWindow.CallBuildMethods
(System.Boolean askForBuildLocation,
UnityEditor.BuildOptions
defaultBuildOptions) [0x00080] in
/Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:95
UnityEngine.GUIUtility:ProcessEvent(Int32,
IntPtr, Boolean&) (at
/Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

Was just agonizing over a similar problem, and I’m using Unity 2020.1.9f1 on a Mac; this solution might not work for you cause of different circumstances but it worked for me. My solution was to go to Edit → Project Settings → Player → Under Other Settings, change the minimum API from whatever the default is to ‘Marshmallow’ Level 23. That’s it, worked like a dream. Good luck!