maui icon indicating copy to clipboard operation
maui copied to clipboard

Maui Blazor Publish Issue

Open QwertyMC opened this issue 2 years ago • 10 comments

Description

When using mudblazor in a .NET 7 Maui Blazor iOS app, the app does not work when published to .ipa for use in App Store or Ad Hoc. App runs fine when run in Debug or Release mode on Device. This only seems to occur when trying to run the published version. BlazorWebview control shows the standard "An unhandled error has occurred"

Steps to Reproduce

  1. Create New Maui Blazor App
  2. Add MudBalzor
  3. Add Controls to index.html
  4. Publish ios and sign Ad Hoc / App Store
  5. Install app
  6. Launch

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 16

Did you find any workaround?

No response

Relevant log output

Unable to set property 'Required' on object of type 'MudBlazor.MudTextField`1[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]'. 
The error was: Attempting to JIT compile method '(wrapper delegate-invoke) void <Module>:invoke_callvirt_void_MudTextField`1<string>_bool (MudBlazor.MudTextField`1<string>,bool)' while running in aot-only mode. 
See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
:    at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.<SetProperties>g__SetProperty|3_0(Object target, PropertySetter writer, String parameterName, Object value)
   at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.SetProperties(ParameterView& parameters, Object target)
   at Microsoft.AspNetCore.Components.ComponentBase.SetParametersAsync(ParameterView parameters)
   at MudBlazor.MudBaseInput`1[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<>n__1(ParameterView parameters)
   at MudBlazor.MudBaseInput`1.<SetParametersAsync>d__177[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()

IMG_D29C473441AA-1

QwertyMC avatar Feb 11 '23 22:02 QwertyMC

I have the exact same issue, also with MudTextField and I don't have any clue on how to solve this.
It only fails when deployed through an .ipa file (but I don't seem to be able to catch the exception)

SamVanhoutte avatar Feb 12 '23 21:02 SamVanhoutte

Any thoughts on this? I've spent quite a bit of time designing this app and not cannot seem to publish it to App Store. Any help would be appreciated! Thank You.

QwertyMC avatar Feb 18 '23 00:02 QwertyMC

Thanks for contacting us. Can you try the suggestion here and see if that helps: https://github.com/dotnet/maui/issues/12537#issuecomment-1379131686?

@lambdageek what should customers do in these situations?

mkArtakMSFT avatar Mar 06 '23 17:03 mkArtakMSFT

/cc @dalexsoto

lambdageek avatar Mar 06 '23 18:03 lambdageek

@vargaz Is this related to https://github.com/dotnet/runtime/issues/83003 - from the error it sounds like this is also something about delegate invoke wrappers and callvirt.

lambdageek avatar Mar 06 '23 19:03 lambdageek

On second thought, this might be due to PropertySetter not being AOT friendly https://github.com/dotnet/aspnetcore/blob/7c931425134d8cf54c82b29baba7ff277849f6bf/src/Components/Components/src/Reflection/PropertySetter.cs#L31-L36

I don't think creating delegates like this will work with AOT - is that right, @vargaz ?

lambdageek avatar Mar 06 '23 19:03 lambdageek

Same issue as: https://github.com/dotnet/runtime/issues/78889

vargaz avatar Mar 06 '23 22:03 vargaz

@vargaz How come it only happens in the app store? shouldn't Release builds deployed on device produce the same problem?

lambdageek avatar Mar 06 '23 22:03 lambdageek

@mkArtakMSFTusing UseInterpreter True` does not help the situation.

QwertyMC avatar Mar 10 '23 05:03 QwertyMC

@vargaz How come it only happens in the app store? shouldn't Release builds deployed on device produce the same problem?

No idea, but the underlying problem appears the same.

vargaz avatar Mar 10 '23 12:03 vargaz

Closing as a dupe of dotnet/runtime#78889

@vargaz do you plan to patch this fix?

mkArtakMSFT avatar Mar 15 '23 17:03 mkArtakMSFT

Its in our queue to fix.

vargaz avatar Mar 15 '23 17:03 vargaz

@mkArtakMSFT What does not planned mean? There is no effort to resolve this issue?

QwertyMC avatar Mar 23 '23 01:03 QwertyMC

Its a duplicate, the issue will be tracked in:

https://github.com/dotnet/runtime/issues/78889

vargaz avatar Mar 23 '23 01:03 vargaz