Hi, I’ve just upgraded my project to Unity 5.1 and I’m getting the following errors:
Anyone know of a fix? I can’t submit a bug report as my project is too big.
Hi, I’ve just upgraded my project to Unity 5.1 and I’m getting the following errors:
Anyone know of a fix? I can’t submit a bug report as my project is too big.
This is a bug (701313) caused by UNetWeaver processing Editor scripts when it should not be. The fix for this will be in an upcoming patch release (probably 5.1p2 as 5.1p1 is in 2 days).
@Meceka found a way to work around this bug. Until the patch release, please
Thanks. I’ll give that a try.
@tobiass I don’t have Photon in my project. If you look, my error is not a null reference.
@derkoi : Sorry, my fault. I thought it’s related but I mixed up topics, apparently.
hi
im getting same errors after upgrading to unity 5.1.0f3 today. No photon in my project either…
UNetWeaver error: Exception :System.ArgumentException: An element with the same key already exists in the dictionary.
at System.Collections.Generic.Dictionary2[System.UInt32,System.UInt32].Add (UInt32 key, UInt32 value) [0x0007e] in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404 at Mono.Cecil.MetadataSystem.SetReverseNestedTypeMapping (UInt32 nested, UInt32 declaring) [0x00000] in <filename unknown>:0 at Mono.Cecil.MetadataReader.AddNestedMapping (UInt32 declaring, UInt32 nested) [0x00000] in <filename unknown>:0 at Mono.Cecil.MetadataReader.InitializeNestedTypes () [0x00000] in <filename unknown>:0 at Mono.Cecil.MetadataReader.InitializeTypeDefinitions () [0x00000] in <filename unknown>:0 at Mono.Cecil.MetadataReader.ReadTypes () [0x00000] in <filename unknown>:0 at Mono.Cecil.ModuleDefinition.<get_Types>b__8 (Mono.Cecil.ModuleDefinition _, Mono.Cecil.MetadataReader reader) [0x00000] in <filename unknown>:0 at Mono.Cecil.ModuleDefinition.Read[ModuleDefinition,TypeDefinitionCollection] (Mono.Cecil.ModuleDefinition item, System.Func
3 read) [0x00000] in :0
at Mono.Cecil.ModuleDefinition.get_Types () [0x00000] in :0
at Unity.UNetWeaver.Weaver.Weave (System.String assName, IEnumerable1 dependencies, System.String unityEngineDLLPath, System.String unityUNetDLLPath, System.String outputDir) [0x00049] in /Users/builduser/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1455 at Unity.UNetWeaver.Weaver.WeaveAssemblies (IEnumerable
1 assemblies, IEnumerable1 dependencies, System.String outputDir, System.String unityEngineDLLPath, System.String unityUNetDLLPath) [0x00060] in /Users/builduser/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1531 UnityEngine.Debug:LogError(Object) Unity.UNetWeaver.Log:Error(String) (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:19) Unity.UNetWeaver.Weaver:WeaveAssemblies(IEnumerable
1, IEnumerable1, String, String, String) (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1538) Unity.UNetWeaver.Program:Process(String, String, String, String[ ], String[ ], Action
1, Action`1) (at /Users/builduser/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:33)
UnityEditor.Scripting.Serialization.Weaver:WeaveUnetFromEditor(String, String, String, String, Boolean)
Failure generating network code.
UnityEditor.Scripting.Serialization.Weaver:WeaveUnetFromEditor(String, String, String, String, Boolean)
This happens when i import a package (seems any package) from the asset store, i tried with ‘master audio’ and ‘skele’ so far both with same errors. if i delete packages errors go.
any fix for this?
cheers.
Try to remove (rename/move) folder with networking extension (if you don’t use this new feature)
\Editor\Data\UnityExtensions\Unity\Networking
Or wait upcoming patch
I upgraded to 5.1.1f1 today and still get the following error:
UNetWeaver error: Exception :System.ArgumentException: An element with the same key already exists in the dictionary.
Following @Arberk above (on Mac OS X 10.10.3), I went into Unity.app > Contents > UnityExtensions > Unity and moved the Networking folder onto my Desktop. I now get the following error when Unity starts up:
Exception generating network code: System.Exception: dll could not be located at /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll!
All is good though - my project now compiles and I can play the game again. I’m not using UNET yet so happy to just be able to work on this project again. Cheers!
same here, i upgraded to 5.1.1f1 today but im still getting the errors as well. I also used the above solution and still get the errors, but can now compile my game.
looking forward to the fix for this.
I tried Unity v5.1.1 p1 and completely reimported my project.
I’m getting a new error now but my old one hasn’t appeared yet…
If I delete the Networking folder as suggested above I can play my game in the editor but I can’t build it.
I updated to 5.1.1p2 and just got this error. Stopped my project cold. Anyone have luck?
What I ended up doing was deleting a lot of packages from my project that I wasn’t using whilst Unity was closed and reimported everything & the error went away. I have no idea which package was causing the issue.
I’m Using Unity 5.1.21f and de issue still there… any news about it? (it happens on Mac OSX 10.9.5).
5.1.2f1
I take the SyncVar off my List temporarily to help it compile then this happens :
This new version is throwing out lots of errors on things it was perfectly happy with in 5.1.1f1. There’s even an error in the error…
“You cannot pass a Compent to a Command”.
I fixed the second error by not passing a transform in to my @Command function but grabbed it from a global variable instead.
EDIT: Damned smileys in the quote! Bit annoying.
i had the same problem in 5.1.2f1.
In My case change a variable from private Text text; to [SyncVar] private Text text;, after change back, the problem was no more exist
PS:
using System;
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.Networking;
I am on version 5.3.1f1 and I also have a similar error on my UNet multiplayer enabled game. This error occurs randomly after 5 or so minutes when playing in a matchmaker hosted game, and causes the match to completely timeout.
Error message:
Open Me
ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary2[UnityEngine.Networking.Types.NetworkID,UnityEngine.Networking.Types.NetworkAccessToken].Add (NetworkID key, UnityEngine.Networking.Types.NetworkAccessToken value) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:453) UnityEngine.Networking.Utility.SetAccessTokenForNetwork (NetworkID netId, UnityEngine.Networking.Types.NetworkAccessToken accessToken) (at C:/buildslave/unity/build/Runtime/Networking/Managed/UNETTypes.cs:119) UnityEngine.Networking.NetworkManager.OnMatchJoined (UnityEngine.Networking.Match.JoinMatchResponse matchInfo) (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkManager.cs:1209) UnityEngine.Networking.Match.NetworkMatch+<ProcessMatchResponse>c__Iterator0
1[UnityEngine.Networking.Match.JoinMatchResponse].MoveNext () (at C:/buildslave/unity/build/Runtime/Networking/Managed/MatchMakingClient.cs:302)
I haven’t read this entire thread yet, but I really hope they are going to address this problem soon!
Just moved from 5.2.3f1 to 5.3.1f1 and my project throws the following error in the editor. Can’t launch my game and monodevelop shows no errors.
I just installed 5.3.1p3 and still get the same errors.
Update and Solution
Again, it was my own problem. I was somehow passing a custom argument type for a remote action. Not sure how this didn’t throw an error before. If you do happen to have a similar error check your remote action Cmd and Rpc methods for unsupported argument types.
Relevant Documentation
http://docs.unity3d.com/Manual/UNetActions.html
Error: Open Me
UNetWeaver error: WriteReadFunc for itemRefs [System.Collections.Generic.List1<System.String>/System.Collections.Generic.List
1<System.String>]. Cannot have generic parameters.
UnityEngine.Debug:LogError(Object)
Unity.UNetWeaver.Log:Error(String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:20)
Unity.UNetWeaver.Weaver:GenerateWriterFunction(TypeReference) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:587)
Unity.UNetWeaver.Weaver:GetWriteFunc(TypeReference) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:290)
Unity.UNetWeaver.NetworkBehaviourProcessor:WriteArguments(ILProcessor, MethodDefinition, String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetBehaviourProcessor.cs:136)
Unity.UNetWeaver.NetworkBehaviourProcessor:processCommandCall(MethodDefinition, CustomAttribute) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetBehaviourProcessor.cs:1074)
Unity.UNetWeaver.NetworkBehaviourProcessor:processMethods() (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetBehaviourProcessor.cs:1297)
Unity.UNetWeaver.NetworkBehaviourProcessor:process() (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetBehaviourProcessor.cs:54)
Unity.UNetWeaver.Weaver:processNetworkBehaviourType(TypeDefinition) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1074)
Unity.UNetWeaver.Weaver:CheckNetworkBehaviour(TypeDefinition) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1558)
Unity.UNetWeaver.Weaver:Weave(String, IEnumerable1, IAssemblyResolver, String, String, String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1667) Unity.UNetWeaver.Weaver:WeaveAssemblies(IEnumerable
1, IEnumerable1, IAssemblyResolver, String, String, String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1757) Unity.UNetWeaver.Program:process(String, String, String, String[ ], String[ ], IAssemblyResolver, Action
1, Action`1) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:34)
UnityEditor.Scripting.Serialization.Weaver:WeaveUnetFromEditor(String, String, String, String, Boolean)
UNetWeaver error: WriteArguments for CmdAddPlayerToServer type Character not supported
UnityEngine.Debug:LogError(Object)
Unity.UNetWeaver.Log:Error(String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:20)
Unity.UNetWeaver.NetworkBehaviourProcessor:WriteArguments(ILProcessor, MethodDefinition, String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetBehaviourProcessor.cs:139)
Unity.UNetWeaver.NetworkBehaviourProcessor:processCommandCall(MethodDefinition, CustomAttribute) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetBehaviourProcessor.cs:1074)
Unity.UNetWeaver.NetworkBehaviourProcessor:processMethods() (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetBehaviourProcessor.cs:1297)
Unity.UNetWeaver.NetworkBehaviourProcessor:process() (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetBehaviourProcessor.cs:54)
Unity.UNetWeaver.Weaver:processNetworkBehaviourType(TypeDefinition) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1074)
Unity.UNetWeaver.Weaver:CheckNetworkBehaviour(TypeDefinition) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1558)
Unity.UNetWeaver.Weaver:Weave(String, IEnumerable1, IAssemblyResolver, String, String, String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1667) Unity.UNetWeaver.Weaver:WeaveAssemblies(IEnumerable
1, IEnumerable1, IAssemblyResolver, String, String, String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1757) Unity.UNetWeaver.Program:process(String, String, String, String[ ], String[ ], IAssemblyResolver, Action
1, Action`1) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:34)
UnityEditor.Scripting.Serialization.Weaver:WeaveUnetFromEditor(String, String, String, String, Boolean)
Failure generating network code.
UnityEditor.Scripting.Serialization.Weaver:WeaveUnetFromEditor(String, String, String, String, Boolean)
I’m getting this as well with the new 5.3.1p4 on a brand new project after importing Grids Pro 1.14.2 :S
I downloaded 5.1.2f1 and it allowed me to not include “networking” libraries in the plug-in I couldn’t get to compile and no error! It appears that any version new than 5.1.2 f1 doesn’t give you the opportunity to un-select networking. Try it!