Skip to content

[BUG] AOT compile fails for iOS MAUI #3184

@J-Swift

Description

@J-Swift

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions