Is it possible to recompile the source code of the SDK to replace the Newtonsoft.Json.dll with the one in the Newtonsoft.Json AOT folder in the above zip?
I’m not looking to move away from Json.NET, just use a modified version for Unity.
I compiled a new contentful .dll and it work for Android, but gave a different error in iOS.
**JsonSerializationException: Unable to find a constructor to use for type Contentful.Core.Models.SystemProperties. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'items[0].sys.space', line 11, position 16.**
JsonSerializationException: Unable to find a constructor to use for type Contentful.Core.Models.SystemProperties. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path ‘items[0].sys.space’, line 11, position 16.
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract objectContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, Newtonsoft.Json.Serialization.JsonProperty containerProperty, System.String id, System.Boolean& createdFromNonDefaultCreator) [0x00000] in <00000000000000000000000000000000>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00000] in <00000000000000000000000000000000>:0
I am using the contentful.Core.dll from the .net sdk and the Newtonsoft.Json.dll nuget
Tested this combination in Unity 2020.1.4f1 and it worked before, now it won’t.
The only thing that changed is the iOS version (updated from 12.x to 13.x)
Could this really be the issue?
@jk123 seemed like we ran into the same error. Could you provide some extra details on how you fixed this?
I implemented the Contentful.Core.dll into a Unity 2020.1 project and built for iOS.
In editor everything works fine. The build however throws an error. Could this also be due to an iOS update?
I am using the Newtonsoft.Json.dll nuget.
JsonSerializationException: Unable to find a constructor to use for type Contentful.Core.Models.SystemProperties. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path ‘items[0].sys.space’, line 11, position 16.
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject (Newtonsoft.Json.JsonReader reader,
@jk123, Do you have some extra information on how you managed to fix this?
Hello @jk123 , @robert1 , could you guys perhaps elaborate a bit on how you got this working?
I’m trying to get Contentful to work with Unity3D 2020.1.16, but so far I’m struggling.
I’m pretty new to both Unity and .NET/C#, so perhaps it’s less of an issue than it seems to me for the moment.
After reading this thread I downloaded the https://github.com/contentful/contentful.net code as a zip and placed the contentful.core folder in to my Assets/plugins folder, accompanied by the Newtonsoft.Json.dll found on Nuget.
Currently I’m getting the following error:
Assets/Plugins/Contentful.Core/Configuration/ExtensionJsonConverter.cs(53,102): error CS0656: Missing compiler required member ‘Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create’
Apart from that I can’t seem to reference the Contentful referenced in other files through
Using Contentful.Core;
Am I going about this completely going with the source files? Do I manually have to add a ProjectReference somewhere?