When I do a build, during Finding AOT Stubs in plugins. I am using Photons Fusion 2 for networking and since I’ve installed visual scripting to do AI behaviour-related things, I’ve been unable to do a build as I get the following errors. When I search for this I get absolutely nothing but the occasional person saying it’s a visual scripting issue in unity. Does anyone have a solution for this, or know a route to go to solve this issue?
A few of the steps I’ve taken are adding all of the fusion libraries to Node libraries, running fix missing scripts and even regenerating the nodes.
I’d really prefer not to have to rip visual scripting out as resetting up all the AI stuff with an alternative solution would take a substantial amount of time.
Thank you for all your help, this is the first time i’ve had no idea where to start with an issue in all of my years using unity.
//short error
Error building Player: TypeLoadException: Could not instantiate Unity.VisualScripting.InstancePropertyAccessor`2[TTarget,TProperty] due to generic type cannot be instantiated with type ‘Fusion.NetworkBehaviourBuffer’ assembly: type: member:(null)
//long error
TypeLoadException: Could not instantiate Unity.VisualScripting.InstancePropertyAccessor2[TTarget,TProperty] due to generic type cannot be instantiated with type 'Fusion.NetworkBehaviourBuffer' assembly:<unknown assembly> type:<unknown type> member:(null) System.RuntimeType.GetConstructors_internal (System.Reflection.BindingFlags bindingAttr, System.RuntimeType reflectedType) (at <605bf8b31fcb444b85176da963870aa7>:0) System.RuntimeType.GetConstructorCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.CallingConventions callConv, System.Type[ ] types, System.Boolean allowPrefixLookup) (at <605bf8b31fcb444b85176da963870aa7>:0) System.RuntimeType.GetConstructors (System.Reflection.BindingFlags bindingAttr) (at <605bf8b31fcb444b85176da963870aa7>:0) System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[ ] args, System.Globalization.CultureInfo culture, System.Object[ ] activationAttributes, System.Threading.StackCrawlMark& stackMark) (at <605bf8b31fcb444b85176da963870aa7>:0) System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[ ] args, System.Globalization.CultureInfo culture, System.Object[ ] activationAttributes) (at <605bf8b31fcb444b85176da963870aa7>:0) System.Activator.CreateInstance (System.Type type, System.Object[ ] args) (at <605bf8b31fcb444b85176da963870aa7>:0) Unity.VisualScripting.OptimizedReflection.GetPropertyAccessor (System.Reflection.PropertyInfo propertyInfo) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Core/Reflection/Optimization/OptimizedReflection.cs:229) Unity.VisualScripting.OptimizedReflection.Prewarm (System.Reflection.PropertyInfo propertyInfo) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Core/Reflection/Optimization/OptimizedReflection.cs:185) Unity.VisualScripting.PropertyInfoStubWriter.GetOptimizedAccessor (System.Reflection.PropertyInfo propertyInfo) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Editor/VisualScripting.Core/Platforms/PropertyInfoStubWriter.cs:12) Unity.VisualScripting.AccessorInfoStubWriter1+d__2[TAccessor].MoveNext () (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Editor/VisualScripting.Core/Platforms/AccessorInfoStubWriter.cs:57)
System.Collections.Generic.LargeArrayBuilder1[T].AddRange (System.Collections.Generic.IEnumerable1[T] items) (at <7b5547b4335144ceb60840e62be9f312>:0)
System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable1[T] source) (at <7b5547b4335144ceb60840e62be9f312>:0) System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable1[T] source) (at <7b5547b4335144ceb60840e62be9f312>:0)
Unity.VisualScripting.AotPreBuilder.CreateCodeCompileUnitFromStubWriters (System.Collections.Generic.IEnumerable1[T] stubWriters) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Editor/VisualScripting.Core/Platforms/AotPreBuilder.cs:354) Unity.VisualScripting.AotPreBuilder.GenerateCodeAndWriteToStream (System.Collections.Generic.IEnumerable1[T] stubWriters, System.IO.TextWriter writer) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Editor/VisualScripting.Core/Platforms/AotPreBuilder.cs:296)
Unity.VisualScripting.AotPreBuilder.FindAndWriteAotStubs (System.IO.TextWriter writer) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Editor/VisualScripting.Core/Platforms/AotPreBuilder.cs:291)
Unity.VisualScripting.AotPreBuilder.GenerateStubScript (System.String scriptFilePath) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Editor/VisualScripting.Core/Platforms/AotPreBuilder.cs:282)
Unity.VisualScripting.AotPreBuilder.GenerateAotStubs () (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Editor/VisualScripting.Core/Platforms/AotPreBuilder.cs:94)
UnityEngine.Debug:LogException(Exception)
Unity.VisualScripting.AotPreBuilder:GenerateAotStubs() (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Editor/VisualScripting.Core/Platforms/AotPreBuilder.cs:98)
Unity.VisualScripting.AotPreBuilder:OnPreprocessBuild(BuildReport) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Editor/VisualScripting.Core/Platforms/AotPreBuilder.cs:86)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()