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.27k stars 1.76k forks source link

[iOS] App exceptions on physical device, but works on the simulator #12503

Closed AndreasReitberger closed 11 months ago

AndreasReitberger commented 1 year ago

Description

I was facing a strange behaviour of my app. It was working fine while running on the simulator. However once I moved to a physical device (iPhone in my case), the app throws exceptions and crashes.

After a while I figured out, that a missing StaticResource, better a missing style, was the issue.

System.Reflection.TargetInvocationException: Position 165:45. StaticResource not found for key DefaultBorderlessEntry

Style="{StaticResource DefaultBorderlessEntry}"

It would have saved me a lot of headache if the Simulator would also throw an exception if a StaticResource is not found. Is there a way to adjust this?

Steps to Reproduce

  1. Already fixed

Link to public reproduction project repository

none

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, I was not able test on other platforms

Affected platform versions

16

Did you find any workaround?

No response

Relevant log output

No response

jfversluis commented 1 year ago

@StephaneDelcroix seems like something you might know more about?

AndreasReitberger commented 1 year ago

It would be even more awesome if the build task already sees that the StaticResource is not found. Like it works with CompiledBindings. https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/data-binding/compiled-bindings

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

ghost commented 1 year ago

Hi @AndreasReitberger. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

Zhanglirong-Winnie commented 1 year ago

Verified this issue with Visual Studio Enterprise 17.9.0 Preview 1.0 and 17.6.7 (build 417). Not repro on iOS platform.