Exceptions after updating to Services.core to 1.10.1

After updating the services.core package to 1.10.1 I get exceptions like this:

[ServicesCore]: Exception occurred when fetching service flags:
System.NotImplementedException: The method or operation is not implemented.
at Unity.Services.Core.Environments.Client.Http.JsonObjectCollectionConverter.CanConvert (System.Type objectType) [0x00001] in .\Packages\com.unity.services.core@1.10.1\Editor\Core\Environments\Client\Http\JsonObjectConverter.cs:142
at Newtonsoft.Json.JsonSerializer.GetMatchingConverter (System.Collections.Generic.IList1[T] converters, System.Type objectType) [0x0000f] in <761cf2a144514d2291a678c334d49e9b>:0 at Newtonsoft.Json.JsonSerializer.GetMatchingConverter (System.Type type) [0x00000] in <761cf2a144514d2291a678c334d49e9b>:0 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.GetConverter (Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.JsonConverter memberConverter, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x0005a] in <761cf2a144514d2291a678c334d49e9b>:0 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000db] in <761cf2a144514d2291a678c334d49e9b>:0 at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00054] in <761cf2a144514d2291a678c334d49e9b>:0 at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <761cf2a144514d2291a678c334d49e9b>:0 at Newtonsoft.Json.Linq.JToken.ToObject (System.Type objectType, Newtonsoft.Json.JsonSerializer jsonSerializer) [0x00034] in <761cf2a144514d2291a678c334d49e9b>:0 at Newtonsoft.Json.Linq.JToken.ToObject (System.Type objectType) [0x002ff] in <761cf2a144514d2291a678c334d49e9b>:0 at Newtonsoft.Json.Linq.JToken.ToObject[T] () [0x00000] in <761cf2a144514d2291a678c334d49e9b>:0 at Unity.Services.Core.Editor.ServiceFlagRequest.ExtractServiceFlagsFromUnityWebRequest (UnityEngine.Networking.UnityWebRequest unityWebRequest) [0x00025] in .\Packages\com.unity.services.core@1.10.1\Editor\Core\ProjectStateManagement\ServiceFlagRequest.cs:89 UnityEngine.Logger:LogError (string,object) Unity.Services.Core.Internal.CoreLogger:LogError (object) (at ./Packages/com.unity.services.core@1.10.1/Runtime/Core.Internal/Logging/CoreLogger.cs:16) Unity.Services.Core.Editor.ServiceFlagRequest:ExtractServiceFlagsFromUnityWebRequest (UnityEngine.Networking.UnityWebRequest) (at ./Packages/com.unity.services.core@1.10.1/Editor/Core/ProjectStateManagement/ServiceFlagRequest.cs:93) Unity.Services.Core.Editor.ServiceFlagRequest:OnFetchServiceFlagsCompleted (UnityEngine.Networking.UnityWebRequest,Unity.Services.Core.Internal.AsyncOperation1<System.Collections.Generic.IDictionary`2<string, bool>>) (at ./Packages/com.unity.services.core@1.10.1/Editor/Core/ProjectStateManagement/ServiceFlagRequest.cs:66)
Unity.Services.Core.Editor.ServiceFlagRequest/<>c__DisplayClass4_1:b__0 (UnityEngine.AsyncOperation) (at ./Packages/com.unity.services.core@1.10.1/Editor/Core/ProjectStateManagement/ServiceFlagRequest.cs:54)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()

I also get the Not Implemented Exception in my custom code, when I call JsonConvert.DeserliazeObject

I don’t get the errors in clean project with only the packages installed.

When I edit the package and replace the exception-throw with “return false” everything seams to work like before.

I found the reason:
We use the Newtonsoft.Json-for-Unity.Converters package which by default loads all JsonConverters it can find, including the ones in the services.core package which are not implemented completely.

Had the same problem, thank you for posting

I deactivated those :wink:

9167960--1276067--upload_2023-7-24_16-17-17.png

Thank you for the information.
Where can I make that setting?

It was located in

Edit > Json.NET converters settings…

Thanks for sharing this workaround in the meantime.

We’ve released com.unity.services.core 1.11.0, it should fix the issue without requiring this.

How does one install this package in for Unity 2021.3?

Click on the plus icon in the top left corner of the package manager, type com.unity.services.core and the version 1.11.0. Then click Add or hit enter to submit.

Thank you for the fast and accurate reply! When I googled how to specifically update that package all the results were unhelpful or “you cannot update core packages”. Happy that it’s not the case!

Hi, I am getting a similar error as soon as I launch my project:

ServicesCore]: Exception occurred when fetching service flags:
System.MissingMethodException: Default constructor not found for type System.Collections.Generic.IDictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
  at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00076] in <bfbc89a04b6b4dd49c3614d03fc31ce8>:0
  at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) [0x00009] in <bfbc89a04b6b4dd49c3614d03fc31ce8>:0
  at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) [0x00027] in <bfbc89a04b6b4dd49c3614d03fc31ce8>:0
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00020] in <bfbc89a04b6b4dd49c3614d03fc31ce8>:0
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <bfbc89a04b6b4dd49c3614d03fc31ce8>:0
  at System.Activator.CreateInstance (System.Type type) [0x00000] in <bfbc89a04b6b4dd49c3614d03fc31ce8>:0
  at WanzyeeStudio.Json.DictionaryConverter.ReadJson (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Object existingValue, Newtonsoft.Json.JsonSerializer serializer) [0x0000c] in C:\Users\mayan\Documents\Projects\Idapt Planner 3D Updated Live\Idapt Planner 3D Live Updated\Assets\Exoa\Common\Packages\Json\WanzyeeStudio\Scripts\Runtime\Concrete\Json\DictionaryConverter.cs:56
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable (Newtonsoft.Json.JsonConverter converter, Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Object existingValue) [0x00055] in <761cf2a144514d2291a678c334d49e9b>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000db] in <761cf2a144514d2291a678c334d49e9b>:0
  at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00054] in <761cf2a144514d2291a678c334d49e9b>:0
  at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <761cf2a144514d2291a678c334d49e9b>:0
  at Newtonsoft.Json.Linq.JToken.ToObject (System.Type objectType, Newtonsoft.Json.JsonSerializer jsonSerializer) [0x00034] in <761cf2a144514d2291a678c334d49e9b>:0
  at Newtonsoft.Json.Linq.JToken.ToObject (System.Type objectType) [0x002ff] in <761cf2a144514d2291a678c334d49e9b>:0
  at Newtonsoft.Json.Linq.JToken.ToObject[T] () [0x00000] in <761cf2a144514d2291a678c334d49e9b>:0
  at Unity.Services.Core.Editor.ServiceFlagRequest.ExtractServiceFlagsFromUnityWebRequest (UnityEngine.Networking.UnityWebRequest unityWebRequest) [0x00019] in .\Library\PackageCache\com.unity.services.core@1.12.2\Editor\Core\ProjectStateManagement\ServiceFlagRequest.cs:89
UnityEngine.Logger:LogError (string,object)
Unity.Services.Core.Internal.CoreLogger:LogError (object) (at ./Library/PackageCache/com.unity.services.core@1.12.2/Runtime/Core.Internal/Logging/CoreLogger.cs:16)
Unity.Services.Core.Editor.ServiceFlagRequest:ExtractServiceFlagsFromUnityWebRequest (UnityEngine.Networking.UnityWebRequest) (at ./Library/PackageCache/com.unity.services.core@1.12.2/Editor/Core/ProjectStateManagement/ServiceFlagRequest.cs:93)
Unity.Services.Core.Editor.ServiceFlagRequest:OnFetchServiceFlagsCompleted (UnityEngine.Networking.UnityWebRequest,Unity.Services.Core.Internal.AsyncOperation`1<System.Collections.Generic.IDictionary`2<string, bool>>) (at ./Library/PackageCache/com.unity.services.core@1.12.2/Editor/Core/ProjectStateManagement/ServiceFlagRequest.cs:66)
Unity.Services.Core.Editor.ServiceFlagRequest/<>c__DisplayClass4_0:<QueryProjectFlags>b__0 (UnityEngine.AsyncOperation) (at ./Library/PackageCache/com.unity.services.core@1.12.2/Editor/Core/ProjectStateManagement/ServiceFlagRequest.cs:54)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()

I am using Unity 2022.3.19f1 and Service Core1.12.2

Not sure how to sort this, can anyone help ?

If you look at line 9 of your stack trace you can see a class in the WanzyeeStudio namespace with a method used for reading Json. My guess is that this conflicts with the usually used Json deserializer of Newtonsoft. Is this strictly necessary for your project or can you try testing without it and see if that solved the error?

@MiTschMR Yes it turns out this plugin “WanzyeeStudio” was the culprit removing this sorted the issue.
Thanks!

I have exact some problem, but can’t figure out how to get rid of this conflict…

Hi @zayyeh , what version of com.unity.services.core are you using ?

If it is 1.11.0 or above (Should be fixed since that version), could you share the error log you are seeing ? Thanks.

I’m experiencing a similar exception.


[ServicesCore]: Exception occurred when fetching service flags:
System.MissingMethodException: Default constructor not found for type System.Collections.Generic.IDictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
  at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00076] in <bed9669261d44da0a59448ecde2b1a5c>:0 
  at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) [0x00009] in <bed9669261d44da0a59448ecde2b1a5c>:0 
  at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) [0x00027] in <bed9669261d44da0a59448ecde2b1a5c>:0 
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00020] in <bed9669261d44da0a59448ecde2b1a5c>:0 
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <bed9669261d44da0a59448ecde2b1a5c>:0 
  at System.Activator.CreateInstance (System.Type type) [0x00000] in <bed9669261d44da0a59448ecde2b1a5c>:0 
  at WanzyeeStudio.Json.DictionaryConverter.ReadJson (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Object existingValue, Newtonsoft.Json.JsonSerializer serializer) [0x0000c] in C:\Users\halim\Documents\Unity game hub\Quiz-Game-master\Quiz Game\Quiz Game prototype\Assets\WanzyeeStudio\Scripts\Runtime\Concrete\Json\DictionaryConverter.cs:56 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable (Newtonsoft.Json.JsonConverter converter, Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Object existingValue) [0x00055] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000db] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00054] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Linq.JToken.ToObject (System.Type objectType, Newtonsoft.Json.JsonSerializer jsonSerializer) [0x00034] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Linq.JToken.ToObject (System.Type objectType) [0x002ff] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Newtonsoft.Json.Linq.JToken.ToObject[T] () [0x00000] in <761cf2a144514d2291a678c334d49e9b>:0 
  at Unity.Services.Core.Editor.ServiceFlagRequest.ExtractServiceFlagsFromUnityWebRequest (UnityEngine.Networking.UnityWebRequest unityWebRequest) [0x00019] in .\Library\PackageCache\com.unity.services.core@9e81a5e38245\Editor\Core\ProjectStateManagement\ServiceFlagRequest.cs:89 
UnityEngine.Logger:LogError (string,object)
Unity.Services.Core.Internal.CoreLogger:LogError (object) (at ./Library/PackageCache/com.unity.services.core@9e81a5e38245/Runtime/Core.Internal/Logging/CoreLogger.cs:16)
Unity.Services.Core.Editor.ServiceFlagRequest:ExtractServiceFlagsFromUnityWebRequest (UnityEngine.Networking.UnityWebRequest) (at ./Library/PackageCache/com.unity.services.core@9e81a5e38245/Editor/Core/ProjectStateManagement/ServiceFlagRequest.cs:93)
Unity.Services.Core.Editor.ServiceFlagRequest:OnFetchServiceFlagsCompleted (UnityEngine.Networking.UnityWebRequest,Unity.Services.Core.Internal.AsyncOperation`1<System.Collections.Generic.IDictionary`2<string, bool>>) (at ./Library/PackageCache/com.unity.services.core@9e81a5e38245/Editor/Core/ProjectStateManagement/ServiceFlagRequest.cs:66)
Unity.Services.Core.Editor.ServiceFlagRequest/<>c__DisplayClass4_0:<QueryProjectFlags>b__0 (UnityEngine.AsyncOperation) (at ./Library/PackageCache/com.unity.services.core@9e81a5e38245/Editor/Core/ProjectStateManagement/ServiceFlagRequest.cs:54)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()