[BUG] AOT compile fails for iOS MAUI

See original GitHub issue

Describe the bug

I’m unable to build an AOT release build for iOS MAUI with ReactiveUI v17.1.17. Building with verbose gives me this

Failed to load method 0x6000472 from '[...]/obj/iPhone/Release/net6.0-ios/ios-arm64/linked/ReactiveUI.dll' due to Could not resolve signature of method ReactiveUI.ReactiveCollectionViewSource`1[TSource]:NumberOfSections.
Mono Ahead of Time compiler - compiling assembly [...]/obj/iPhone/Release/net6.0-ios/ios-arm64/linked/ReactiveUI.dll
Run with MONO_LOG_LEVEL=debug for more information.
AOTID 765DC80D-F50C-E335-7D3F-74B08B59D889
AOT of image [...]/obj/iPhone/Release/net6.0-ios/ios-arm64/linked/ReactiveUI.dll failed.
Could not load signature of ReactiveUI.ReactiveCollectionViewSource`1[TSource]:NumberOfSections due to: Could not resolve type with token 010000b4 from typeref (expected class 'System.nint' in assembly 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065') assembly:Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065 type:System.nint member:(null)

Steps To Reproduce

Not sure on a repro just yet, but it fails for me when doing the following build:

dotnet build MyApp -t:Build -c:Release -f:net6.0-ios -p:Platform=iPhone -p:RuntimeIdentifier=ios-arm64 \
    -p:BuildIpa=True -p:OutputPath='bin/Simulator/' -p:TreatWarningsAsErrors=True

Expected behaviour

AOT compile works

Environment

  • OS: macOS
  • Version 12.2
  • Device: intel-chip macbook pro
  • ReactiveUI Version: 17.7.17

Additional context

dotnet version: 6.0.200 (installed via daily https://aka.ms/dotnet/6.0.2xx/daily/dotnet-sdk-osx-x64.pkg) xcode version: 13.2.1 MAUI version: preview 12

I installed the MAUI workload like this

sudo dotnet workload install maui --from-rollback-file https://aka.ms/dotnet/maui/preview.12.json \
    --source https://aka.ms/dotnet6/nuget/index.json  --source https://api.nuget.org/v3/index.json

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:27 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
J-Swiftcommented, Apr 26, 2022

@glennawatson brief update here: initial testing of the latest (v18.0.7) with Maui RC1 looks to fix the issues. I haven’t fully tested but I’m optimistic.

1reaction
PureWeencommented, Feb 15, 2022

P13 for .NET MAUI landed today

It might be worth getting latest RxUI bits compiled against that and then install P13 .NET MAUI

And see if life improves?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Aot compilation fail when publishing for iOS · Issue #8286
Description I'm trying to publish a maui app on a windows pc by pairing it with a Mac, with the command dotnet publish...
Read more >
entity framework core - Failed to AOT compile MyLibrary.dll ...
1 Answer. There is an existed issue about Aot compilation fail when publishing for iOS. It has the same error message as yours....
Read more >
error : Failed to AOT compile for .NET MAUI iOS
AOT compile error for MAUI-iOS -f:net6.0-ios for multiple modules. ... Tool /Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.
Read more >
The AOT compiler '' does not exist. - Microsoft Q&A
the problem is when I am try to build my code Maui App in VS code then I got the problem like this...
Read more >
Failed to AOT compile Microsoft.Maui.Controls.dll
I just updated my Maui app to .NET 7 and I now get this error when building for ios in Azure Devops Pipeline....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found