Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Help: Queues can not be deserialized on iOS devices #51

Answered by applejag
felipegodias asked this question in Q&A
Discussion options

You must be logged in to vote

Ha! Interesting find! I was able to reproduce this when building to Windows with IL2CPP. Here's what's going on:

The Query<> type is neither an IList<> nor an ICollection<>, but instead only a IReadOnlyCollection<>, which makes it so it doesn't contain any of the .Add() methods that comes with IList<> and ICollection<>.

How the official Json .NET package handles this is by trying to obtain the parameterized constructor new Queue<T>(IEnumerable<T>), which has been omitted by the bytecode stripping when compiling with IL2CPP and therefore you receive the error that it cannot be deserialized.

See in the source for reference, where declaring if it's deserializable actually lands on if it can …

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by applejag
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #51 on December 10, 2020 11:17.