-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[iOS] Trimming / AOT issue after publish in .NET MAUI Blazor app #14271
Comments
Blazor folks - I think we've seen similar issues when using MudBlazor before. Does this look familiar and/or related to past issues? |
Doesn't look familiar. All previous issues were easy to trace and fix. It was mainly related to JS Interop. |
Sorry to tag directly, but can you assist @vitek-karas |
I think we will need somebody from the iOS AOT side: The question for me is "What does that failure actually mean?"
I don't know how to answer this, since I know very little about mono iOS AOT. What are the versions in use - the SDK version and TFM of the app? |
As I understand TFM is net7.0-ios, sdk 7.0.104-7.0.202
|
Maybe worth to mention that The Could it hit the Limited Generics Support in iOS AOT? |
@ScarletKuro |
Maybe @rolfbjarne could assist as well. Currently I would suggest @assemblysoft to try setting <!-- Or None -->
<MtouchLink>SdkOnly</MtouchLink>
<UseInterpreter>True</UseInterpreter> in the PropertyGroup. |
This part of the error:
Indicates that the AOT compiler ran into a method it couldn't AOT-compile, and then executing that method failed at runtime. It's likely that enabling the interpreter will fix this (as @ScarletKuro) suggested. |
@ScarletKuro @rolfbjarne can confirm that after applying the above, this has resolved the issue and we have successfully deployed and tested via App Store Connect (TestFlight). |
This seems to be a duplicate of: #13279 and further: dotnet/runtime#78889 There is a global tracking issue: dotnet/runtime#83329 which would hopefully resolve all related issues. |
Thanks everyone for such fast help.
|
Description
I'm not sure if this issue should go here or under the dotnet/runtime, but the problem is following.
MudBlazor users report problem when they publish app on iOS. Meanwhile, it runs normally in Debug / Release mode on the device.
The problem is shown in the stack trace. I suspect that the setter property is getting removed and then
SetParametersAsync
->ComponentProperties.SetProperties
throws exception, because it's using reflection to set the value.At first I thought it's some MudBlazor trimming issue, but it's not. The razor components are protected via Blazor framework, the
RenderTreeBuilder
,RootComponentMappingCollection
etc are annotated with[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
and it should preserve everything in the component.Worth to mention that MudBlazor supports trimming in general, and it's used by many people and there was never such problem encountered.
The same code will work perfectly fine when used in Browser and published with trimming enabled!
If I'm not wrong, iOS has AOT compilation requirements, and maybe it's way too aggressive. I should note that Blazor supports only partial TrimMode, but I'm not sure if MAUI uses
ILLink
as Blazor WASM does.Additional information: Android is unaffected. Internal MudBlazor issue: MudBlazor/MudBlazor#6310
Steps to Reproduce
Link to public reproduction project repository
https://github.com/QwertyMC/MauiBlazorTest
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 14 and higher
Did you find any workaround?
No. Seems ILLink.Descriptors.xml / BlazorLinkerDescriptor doesn't have any effect.
Relevant log output
The text was updated successfully, but these errors were encountered: