dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.21k stars 1.75k forks source link

iOS crash with TestFlight, UseInterpreter no longer working properly with latest .NET8 #24836

Closed JawadJaber closed 1 month ago

JawadJaber commented 1 month ago

Description

I reported an issue before and now it is repeated #9597 , I have faced the same issue before and you advised to user interpreter to fix it. That was working great during the past two years. However, with latest updates the app crashes at the same point only after I released the app in the app store or in TestFlight.

Pls note that I have verified the case with iOS17.5 and iOS18

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.90, 8.0.82, 8.0.20

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.6 SR1

Affected platforms

iOS

Affected platform versions

iOS 17.5, iOS18

Did you find any workaround?

No response

Relevant log output

Here is my current .net workload list
Installed Workload Id      Manifest Version       Installation Source
----------------------------------------------------------------------------------------------------
android                    34.0.138/8.0.100       SDK 8.0.400, VS 17.8.34212.112, VS 17.10.35122.118
aspire                     8.2.0/8.0.100          SDK 8.0.400, VS 17.10.35122.118
ios                        17.5.8030/8.0.100      SDK 8.0.400, VS 17.8.34212.112, VS 17.10.35122.118
maccatalyst                17.5.8030/8.0.100      SDK 8.0.400, VS 17.8.34212.112, VS 17.10.35122.118
maui-windows               8.0.82/8.0.100         SDK 8.0.400, VS 17.8.34212.112, VS 17.10.35122.118
wasm-tools                 8.0.8/8.0.100          SDK 8.0.400, VS 17.10.35122.118
wasm-tools-net6            8.0.8/8.0.100          SDK 8.0.400, VS 17.10.35122.118
github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

tj-devel709 commented 1 month ago

Hi, thank you for your feedback. Are you able to post any relevant crash logs from Apple?

JawadJaber commented 1 month ago

Hi, thank you for your feedback. Are you able to post any relevant crash logs from Apple?

The strange thing in this case is that no crash reports are showing in any of Apple crash locations. Even I could not catch the exception in anyway.

guyvaio commented 1 month ago

The original post was about serialization and deserialization crash in TestFlight version. I encountered a similar situation. The problem was with the trimming. I fixed it by rooting System.Private.CoreLib.dll, done adding this in the project:

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios' And '$(Configuration)'=='Release'">
    <TrimmerRootAssembly Include="System.Private.CoreLib" />
</ItemGroup>

Other assemblies might be needed.

JawadJaber commented 1 month ago

The original post was about serialization and deserialization crash in TestFlight version. I encountered a similar situation. The problem was with the trimming. I fixed it by rooting System.Private.CoreLib.dll, done adding this in the project:

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios' And '$(Configuration)'=='Release'">
    <TrimmerRootAssembly Include="System.Private.CoreLib" />
</ItemGroup>

Other assemblies might be needed.

Thanks for your feedback, I just tried your proposed solution and it worked! I am able to do serialization/deserialization with version 8.0.90

drasticactions commented 1 month ago

@rolfbjarne Could this be an issue with the Interpreter and/or runtime? If you're building on different runtimes and/or iOS Workloads and now you need to enable TrimmerRootAssembly for CoreLib where you didn't need to before, that seems like it could be suspect.

rolfbjarne commented 1 month ago

@rolfbjarne Could this be an issue with the Interpreter and/or runtime? If you're building on different runtimes and/or iOS Workloads and now you need to enable TrimmerRootAssembly for CoreLib where you didn't need to before, that seems like it could be suspect.

One possible scenario is that the code isn't trimmer safe, yet it's still trimmed. It's not unfeasible this code may have worked in the past, but doesn't anymore ("not trimmer safe" means that trimming results may be unpredictable and may change between releases).

jfversluis commented 1 month ago

OK looks like this is fixed, thanks all!