-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vector2 converter not working on iOS #63
Comments
Hi @unnanego! Thanks for reaching out :) I'm lacking context through. The error message is too general. Could you supply me with the full error message? I know it's tricky to get it from the phone, but if you could get the errors forwarded to your editor then you can copy it from the logs there. If you could provide the C# types you are trying to use as well that would help a lot. And does the error occur on serialization (to-string) or deserialization (from-string)? |
|
It happens on serialization. The type: public struct Coordinates
{
public float Latitude
{
get;
}
public float Longitude
{
get;
}
public Vector2? AutoPoint;
public Vector2? ManualPoint;
public Coordinates(float latitude, float longitude)
{
Latitude = latitude;
Longitude = longitude;
AutoPoint = new Vector2(0f, 0f);
ManualPoint = null;
}
} |
Awesome, thanks for clarifying! My guess is that this is caused by the Converter getting stripped out as it's not explicitly referenced. Try save the following as <linker>
<assembly fullname="Newtonsoft.Json.UnityConverters" />
</linker> If that solves the issue, then I can update the Newtonsoft.Json-for-Unity.Converters package so the stripping is disabled by default. If you want to know more about this stripping mechanic of the compilation process, I recommend the following documents: |
Yes, it did the trick, thank you! |
I'm reopening this and using it to track that I need to fix this permanently. I've also moved this issue the converters repo. If you stay subscribed to this issue, then you can get a notification when this has been fixed with a new version, and can then remove that |
Just came across this when building for WebGL. |
I have both packages (latest versions) installed from the jilleJr source. It works fine in the editor, but gives the "self referencing" error on iOS. Unity version 2020.3.18f
The text was updated successfully, but these errors were encountered: