Skip to content
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

Bug: JSON deserialization error occurs on ARM64 builds (aka port to .NET 9) #29

Open
ilGianfri opened this issue Dec 10, 2024 · 11 comments
Assignees
Labels
feature New feature or request

Comments

@ilGianfri
Copy link

ilGianfri commented Dec 10, 2024

I'm getting this error on launch on the latest store version, the app does not display anything. Seems something is not getting parsed correctly in the json.

Home:
image

Notifications:
image

I've tried to launch the app in debug from the master branch and everything works, no errors and TL loads correctly.

@gus33000
Copy link

gus33000 commented Dec 11, 2024

Same here; reproduces fine and I am unable to use the app

The JSON value could not be converted to System.String. Path: $.view.creator.description I LineNumber: O I BytePositionlnLine: 790.
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack&, Utf8JsonReader&, Exception) + 0x4c
at System.Text.Json.Serialization.JsonConverteÖ1.ReadCore(Utf8JsonReader&, T&, JsonSerializerOptions, ReadStack&) + 0x258
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpar€1, JsonTypelnf&1, Nullabl@l) + Oxdc
at JsonTypelnfo'1) + Ox15c
at System.Text.Json.JsonSerializer.Deserialize[TValue](String, JsonTypelnfo'1) + 0x60
at FishyFlip.Tools.HttpClientExtensions.<Get>d_ö1.MoveNext() +
- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchlnfo.Throw() + 0x24
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + Oxac
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x58
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x24
at FishyFlip.Tools.ATProtocolExtensions.<Get>d_ff1.MoveNext() + Ox190
End of stack trace from previous location where exception was thrown
at System.Runtime.ExceptionServices.ExceptionDispatchlnfo.Throw() + 0x24
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + Oxac
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x58
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x24
at DarkSky.Core.ViewModels.HomeFeedViewModel.<Setup>d_4.MoveNext() + 0x40c

Above stack trace was copy pasted using OCR technology; mistakes can exist as a result; consider enabling copy pasting stack traces to improve such experience

@SirKubiac
Copy link

Same error on a Surface Pro 11 with Snapdragon CPU. No problems on my Notebook with Intel x64 CPU.
Screenshot (3)

@FireCubeStudios
Copy link
Owner

@gus33000 @ilGianfri are your devices arm64?

@ilGianfri
Copy link
Author

@gus33000 @ilGianfri are your devices arm64?

Yes, it's a Galaxy Book4 Edge arm64

@FireCubeStudios FireCubeStudios added bug Something isn't working meta::needs/help-wanted Extra attention is needed labels Dec 11, 2024
@FireCubeStudios FireCubeStudios self-assigned this Dec 11, 2024
@FireCubeStudios FireCubeStudios changed the title Json deserialization error on launch Json deserialization error on launch - arm64 Dec 11, 2024
@FireCubeStudios
Copy link
Owner

So it seems that this could be an issue with .NET Native on arm64 not working with the ATProto FishyFlip library that is being used. Another uwp app called Unisky also seems to have the same issue.

To temporarily fix this in the short term I will only be deploying x64 and x86 builds to the store and hopefully it will work with emulation even if this is not ideal.

I think this issue can be fixed by upgrading the project to UWP .NET 9 NativeAOT. Just to be sure however I will create a test app to see if the library works on UWP .NET 9. Since I don't have an arm64 device myself it would be up to someone else with an arm64 device to test if the UWP .NET 9 test app works. If it does then I will immediately start porting DarkSky to UWP .NET 9. If it does not work then we will see.

@SirKubiac
Copy link

I can test this version, if you want. Just let me know.

@FireCubeStudios
Copy link
Owner

More updates from information in Discord:

When compiling with debug arm64 the app works normally.

Some things like profile page work even in store release arm64 while other things don't 🤔https://discord.com/channels/714581497222398064/753345992543305808/1316388324088217681
https://discord.com/channels/714581497222398064/753345992543305808/1316388685146755164

@FireCubeStudios
Copy link
Owner

So 0.3.8 is out in the store. Is it possible to update to that and see if it works?

@SirKubiac
Copy link

It works. No error, no crash so far. 👌
Screenshot (4)

@FireCubeStudios
Copy link
Owner

Nice, in the meanwhile we got devs that are smarter than me working on trying to figure out what went wrong with the arm64 build.

I will change the name of this issue to "UWP .NET 9 NativeAOT port" as that is the long term plan for DarkSky and it would prevent future .NET Native issues whether on arm64 or not

@FireCubeStudios FireCubeStudios changed the title Json deserialization error on launch - arm64 UWP .NET 9 NativeAOT port Dec 11, 2024
@FireCubeStudios FireCubeStudios added feature New feature or request and removed bug Something isn't working meta::needs/help-wanted Extra attention is needed labels Dec 11, 2024
@Lamparter
Copy link
Collaborator

Let's create a new issue for tracking the UWP .NET 9 port

@Lamparter Lamparter changed the title UWP .NET 9 NativeAOT port Bug: JSON deserialization error occurs on ARM64 builds Dec 21, 2024
@FireCubeStudios FireCubeStudios changed the title Bug: JSON deserialization error occurs on ARM64 builds Bug: JSON deserialization error occurs on ARM64 builds (aka port to .NET 9) Dec 22, 2024
@Lamparter Lamparter added this to the .NET 9 NativeAOT milestone Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants