Parameter name: Method GetStorageMemorySize of UnityEditor.TextureUtil not found

My code is not referenced in the error below, so where should I start troubleshooting?

ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Method GetStorageMemorySize of UnityEditor.TextureUtil not found for delegate type System.Func`2[UnityEngine.Texture,System.Int32]
vTvh5fe1rLix9d8GwhjNpIOL$$fi4$$g4zvgxvjvDv5yUvtb$8V5JuWhoL0QJddLtg.YSeGAPcSkEaZSU13JS1M62FhYRGOeMbitD78z1SbK$7J[] (System.Type , System.String , System.Reflection.BindingFlags ) (at <2cf6d0296faf49c2acf04c5692a32cbc>:0)
GtmIBan2qTR9Wl2C57ABjn$tnVj9iZe92jIgcTY7kGzqq3ub5CES01wz77c86s3GgNbq5UikIqDKoH$Jsom3yNE..cctor () (at <2cf6d0296faf49c2acf04c5692a32cbc>:0)
Rethrow as TypeInitializationException: The type initializer for 'GtmIBan2qTR9Wl2C57ABjn$tnVj9iZe92jIgcTY7kGzqq3ub5CES01wz77c86s3GgNbq5UikIqDKoH$Jsom3yNE' threw an exception.
Better.BuildInfo.BuildInfoProcessor.sXIc_FLcVM38_t3OA2Ky7tZYA7DlyUMZlHW8Ieva7e7i (UnityEngine.SceneManagement.Scene , System.String , System.Collections.Generic.Dictionary`2[TKey,TValue] ) (at <2cf6d0296faf49c2acf04c5692a32cbc>:0)
Better.BuildInfo.BuildInfoProcessor.OnPostprocessScene () (at <2cf6d0296faf49c2acf04c5692a32cbc>:0)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <fd2d3e9b010a4ba4b3fdc0456cd6b40b>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:190)

Error building Player: 2 errors

Build completed with a result of 'Failed' in 5 seconds (4751 ms)
3 errors
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:190)

BetterBuildInfo: The build seems to have failed or been interrupted
UnityEngine.Debug:LogWarning (object)
a_6ap3G0pZcXAt9vvop$IXBGbNmCLWRiyES2e2OYJQ_g:4EFeWaKEnePpGNcb_Cg5QtI (string,object[])
Better.BuildInfo.BuildInfoProcessor:LyTr7_hutXmHkvycvvYsvcE ()
Better.BuildInfo.BuildInfoProcessor/PAUY_0jon17FAm7rPh3Z6NepbKMu6gnyCd6f2Erpj7YJgXpep5w9zL6F0Oya0arscw:ilMPUnwLToykuq3Y$3dYD1A ()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions () (at /Users/bokken/build/output/unity/unity/Editor/Mono/EditorApplication.cs:362)

Please note:

  • Error is displayed during build to visionOS (experimental)
  • Unity Version is 22.3.16f1
  • The same error occurs for both VR and MR
  • Apple vsionOS XR Plugin version 0.7.1
  • A simplified scene (with the same settings and packages) builds successfully and plays to the Vision Pro Simulator.

Any idea what might cause this error?, or where I might start troubleshooting?

Also note, I had no trouble building and running this scene for native MacOS.

Given that the exception appears to be generated by Better.BuildInfo (this package?), you might try reaching out to its developer and see if they can give you some insight into the obfuscated parts of the stack trace. Or, to start, just see if the player builds without that package installed. I note that it seems to be calling TextureUtil.GetStorageMemorySize (via reflection), which isn’t a public API.