xamarin-macios icon indicating copy to clipboard operation
xamarin-macios copied to clipboard

[iOS/Catalyst] error: Failed to load AOT module 'System.Private.CoreLib'

Open jeromelaban opened this issue 1 year ago • 6 comments

Steps to Reproduce

  1. Install .NET SDK 8.0.100
  2. Build a MAUI app, using the CLI
  3. Debug the app
  4. Make sure to not clean the app's bin/obj
  5. Install .NET SDK 8.0.200
  6. 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.

jeromelaban avatar Feb 14 '24 22:02 jeromelaban

Probably related https://github.com/dotnet/maui/issues/20600 and https://github.com/dotnet/sdk/issues/38769

dalexsoto avatar Feb 15 '24 03:02 dalexsoto

Closing as dup of https://github.com/dotnet/sdk/issues/38769.

rolfbjarne avatar Feb 15 '24 07:02 rolfbjarne

@rolfbjarne just to make a precision around the installed version, here's what was installed when 8.0.200 is used:

image

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.

jeromelaban avatar Feb 15 '24 12:02 jeromelaban

OK, that makes sense.

rolfbjarne avatar Feb 15 '24 12:02 rolfbjarne

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 avatar Feb 16 '24 17:02 rolfbjarne

@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!

jeromelaban avatar Feb 16 '24 19:02 jeromelaban

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

projectgoav avatar Feb 21 '24 11:02 projectgoav

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!

rolfbjarne avatar Feb 21 '24 11:02 rolfbjarne

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.