Apologies if this is not the right place to ask about this error. I've been at this for 4-5 days.
-
Specs: **protobuf-net 3.0.73 integrated into a Unity 2019.4.6f1 project that targets .NET Standard 2.0 when building for Xbox console with IL2CPP set to Low Stripping.**
Exact log: "MissingMthodException: Default constructor not found for type ProtoBuf.Internal.PrimaryTypeProvider"
-
The project built in Editor works exactly as intended and that's why I think it's the IL2CPP stripping.
Error is reported when attempting to assign a new data field of ProtoTest.
Might be important to note that the ProtoTest class is a C# Library DLL coded and programmed outside of the Unity environment, as required per ProtoBuf Custom serialization. (To my knowledge). I then built it and ported it into Unity Plugins folder along with the matching Serializer.
ProtoTest saveFile = new ProtoTest(); // This is the call made where the code will fail
----- // Decorated class
[ProtoContract()]
public class ProtoTest
{
[ProtoMember(1)]
public string testString;
[ProtoMember(2)]
public int testint;
[ProtoMember(3)]
public int testBool;
[ProtoMember(4)]
public int[] testFixedIntArray;
[ProtoMember(5)]
public List testList = new List();
[ProtoMember(6)]
public Dictionary testDictionary = new Dictionary();
// This is the constructor that is being stripped (to my knowledge)
public ProtoTest() { }
}
I suspect that some off the protobuf files are being stripped during the build, I don't have a lot of experience with handling this. However I attempted to omit the protobuf namespace from stripping by writing a Linker referencing the namespaces used to create all the protobuf data I know of.
Might be important to note that the ProtoTest class is a C# Library DLL coded and programmed outside of the Unity environment, as required per ProtoBuf Custom serialization. (To my knowledge).
Attempt 1
Attempt 2
Attempt 3
↧