xamarin-macios
xamarin-macios copied to clipboard
[iOS/Catalyst] error: Failed to load AOT module 'System.Private.CoreLib'
Steps to Reproduce
- Install .NET SDK 8.0.100
- Build a MAUI app, using the CLI
- Debug the app
- Make sure to not clean the app's bin/obj
- Install .NET SDK 8.0.200
- Build and debug the app (no rebuild)
Expected Behavior
The app starts
Actual Behavior
error: Failed to load AOT module 'System.Private.CoreLib' while running in aot-only mode: doesn't match assembly.
(Actual stack trace got lost by the original user)
Environment
macOS 13, .NET 8.0.100 and 8.0.200
Build Logs
Unavailable at this time, but reproducing may be straightforward.
Workaround
Clean the bin/obj folders.
Probably related https://github.com/dotnet/maui/issues/20600 and https://github.com/dotnet/sdk/issues/38769
Closing as dup of https://github.com/dotnet/sdk/issues/38769.
@rolfbjarne just to make a precision around the installed version, here's what was installed when 8.0.200 is used:
I believe those are the right ones (at least they match what VS windows is installing), as they were installed through a rollback file.
I would tend to think that this issue is rather a cache issue, where the bin/obj make a copy of some of the runtime files which are not refreshed when the workloads are updated.
OK, that makes sense.
reproducing may be straightforward.
It wasn't, I couldn't reproduce with a simple test project.
This may depend on the code in a project and which references it has :/
I certainly believe you when you say there's an issue here, but without a way to reproduce it (or at least see exactly what's happening in the build - a binlog might have enough information to understand what's happening), there's unfortunately not much we can do about it, so I'll mark this as needing a test case.
@rolfbjarne Agreed, I don't see how you may be able to fix this without a repro, I mentioned it as it may be related to something you knew about. I don't have a way to reproduce from the original repo, I do not have access to it either.
Thanks for the update!
I get this 100% of the time when our app launches on iOS12 built under .NET 7.
Same app runs fine on iOS13+. Not sure if it could be related. Will attempt to get more logs & details
I get this 100% of the time when our app launches on iOS12 built under .NET 7.
Same app runs fine on iOS13+. Not sure if it could be related. Will attempt to get more logs & details
That's probably unrelated, so please file a new issue with your logs & details to avoid making this one confusing. It's much easier to merge them later on if it turns out to be the same problem!
Hi @jeromelaban. We have added the "need-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/xamarin/xamarin-macios/blob/main/docs/bug-repro.md
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.
Hi @jeromelaban. Due to inactivity, we will be closing this issue. Please feel free to re-open this issue if the issue persists. For enhanced visibility, if over 7 days have passed, please open a new issue and link this issue there. Thank you.