maui: iOS Release builds stopped working after last update
Description
App crashes immediatly with XamlParseException “Cannot assign property “Property”: Property does not exist, or is not assignable, or mismatching type between value and property (XamlParseException)”.
This seems to be caused by style setters? Works fine in debug, also works fine for all builds on Android.
Steps to Reproduce
It seems like this has to do with style setters beeing removed by the linker. It happens immeiatly when I launch the app.
Link to public reproduction project repository
None
Version with bug
7.0 (current)
Last version that worked well
7.0 (current)
Affected platforms
iOS
Affected platform versions
iOS 16.2
Did you find any workaround?
No response
Relevant log output
XamlParseException "Cannot assign property "Property": Property does not exist, or is not assignable, or mismatching type between value and property (XamlParseException)".
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 5
- Comments: 28 (12 by maintainers)
I’m expremely pressed for time, and I don’t know if I can do this in the timeframe required. Meanwhile, I’m deploying debug builds to the AppStore, while looking into a way to use an older version of Maui in my iOS pipeline.
There’s a number of serious bugs I’ve simply skipped reporting because of this open-repo requirement. It’s too much work I don’t have time for, and it doesn’t really feel like the team takes bug reports seriously anyway.
Maui is not production-ready (unfortunaly for me, given that I’m developing a major project using it).
Actually it seems disabling linker on iOS Release builds does not resolve this issue, making this is a much more serious issue. But positively removing our DataTrigger does prevent the crash, so hopefully a pointer in what to test for a repro and fix.
This has started to affect us in one of our major ongoing Maui projects also after a VS update. Disabling linker will get us away for now, but we can’t go to production until this issue is fixed… Would be good to see some priority given to this.
From looking at line numbers in the exception, assuming it relates to Xaml, I think it is occurring for us in a Data Trigger on a Button Text Property:
You should be able to install a release build locally by using the same codesigning identity + provisioning profile you use for debug builds.
Similar-sounding issues with exceptions during release builds (and the knowledge that by default the interpreter is enabled for debug builds in MAUI, but disabled for release builds).
On iOS, it’s not possible to generate executable machine code at runtime (i.e. JIT compile code), because Apple doesn’t allow it. Thus we use an Ahead-Of-Time compiler, which compiles everything to native code at build time - but this has a few limitations (there’s no support for System.Reflection.Emit for instance). We developed an interpreter to get around these limitations, and incidentally the interpreter is also required for a few debug features (hot reload for instance), and it’s thus enabled by default for debug builds. The downside is that it’s fairly easy to end up with a dependency on the runtime features of the interpreter - because it just works during debug.
Why aren’t we enabling the interpreter for all build configurations? Because there may be performance concerns in some cases, but we’re investigating this and may end up doing exactly that (enabling the interpreter for all build configurations).
The best way to do this is to create a Release build, but with the codesigning identity + provisioning profile you use for a debug build, and install and test it on a device. You won’t be able to attach a debugger, but you’ll be able to verify that a release build works as expected.