Closed riccardominato closed 6 months ago
@rolfbjarne thoughts?
This happens because MAUI disables the linker:
and when the linker is disabled, the app will effectively contain bindings for these PassKit and NewsstandKit types, and then the build process ends up showing these warnings that these types won't work as expected.
Note that the linker is only disabled by default in the Debug configuration, so if you build for Release there are no warnings:
dotnet build -p:RuntimeIdentifier=ios-arm64 -p:Configuration=Release
Thank you @rolfbjarne. I've seen that these warnings can throw unhandled exceptions at runtime (https://github.com/dotnet/maui/issues/18528, https://github.com/xamarin/xamarin-macios/issues/18964).
If I need to debug a iOS app on a physical device, should I be worried of unexpected crashes due to this issue? Are these warnings meant to be there during physical devices debug sessions or should we expect a fix?
I've seen that these warnings can throw unhandled exceptions at runtime (#18528, xamarin/xamarin-macios#18964).
No, these warnings do not indicate that you'll get unhandled exceptions at runtime (unless you use PassKit/NewsstandKit - but then again you shouldn't do that, because it won't work anyway since Apple removed those frameworks). The warnings are just a side-effect of the fix for the unhandled exceptions.
Ok, it's more clear now.
Nonetheless, I think having warnings in a simple build, even if they're harmless, should be avoided. Surely not the most urgent task, though.
Thank you again!
Verified this issue with Visual Studio 17.10.0 Preview 3 (8.0.20 & 8.0.0-rc.2.9530). Can repro this issue. If you change the linker setting to ‘Link Framework SDKs Only’ and build again, the warning will disappear.
This issue was moved to xamarin/xamarin-macios#20670
Description
Creating and building a fresh .NET MAUI app for a physical device raise some warning on iOS. This should be already fixed as described in https://github.com/xamarin/xamarin-macios/issues/18964.
The same thing doesn't happen with a fresh .NET iOS app. The build command is exactly the same.
XCode version: 15.0.1 (15A507)
Steps to Reproduce
dotnet new maui
.dotnet build -f net8.0-ios -p:RuntimeIdentifier=ios-arm64
.To check that .NET iOS doesn't have this problem replace point 1 with
dotnet new ios
.Link to public reproduction project repository
Just create a new .NET MAUI app
Version with bug
8.0.3
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
17
Did you find any workaround?
No response
Relevant log output