Skip to content

[Bug]: Linking fails for iOS device builds with version 20.2.45 #3997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Qonstrukt opened this issue Mar 20, 2025 · 4 comments
Open

[Bug]: Linking fails for iOS device builds with version 20.2.45 #3997

Qonstrukt opened this issue Mar 20, 2025 · 4 comments
Labels

Comments

@Qonstrukt
Copy link
Member

Describe the bug 🐞

While creating a local build for my iOS device, I'm met with the following error:

1>Microsoft.NET.ILLink.targets(96,5): Error NETSDK1144 : Optimizing assemblies for size failed.

Step to reproduce

  1. Have a project with net9.0-ios as TargetFramework
  2. Upgrade ReactiveUI from 20.1.63 to 20.2.45
  3. Start a device build (even with MtouchLink set to None)

Reproduction repository

https://github.com/reactiveui/ReactiveUI

Expected behavior

The build should succeed. This is a very clear difference between the previous and current version. I tried with clean build directories, and can reproduce it every time.

I unfortunately don't have a reproduction repository yet.

Screenshots 🖼️

No response

IDE

Rider macOS

Operating system

MacOS

Version

15.3.2

Device

iPhone 15 Pro

ReactiveUI Version

20.2.45

Additional information ℹ️

Simulator builds are unaffected.

This is the full error:

1>ILLink: Error IL1012 : IL Trimmer has encountered an unexpected error. Please report the issue at https://aka.ms/report-illink
Fatal error in IL Linker
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Collections.Immutable.ImmutableArray`1.get_Item(Int32 index)
   at Mono.Linker.Dataflow.TrimAnalysisMethodCallPattern.Merge(ValueSetLattice`1 lattice, TrimAnalysisMethodCallPattern other)
   at Mono.Linker.Dataflow.MethodBodyScanner.HandleCall(MethodBody callingMethodBody, Instruction operation, Stack`1 currentStack, Dictionary`2 locals, InterproceduralState& interproceduralState, Int32 curBasicBlock)
   at Mono.Linker.Dataflow.MethodBodyScanner.Scan(MethodIL methodIL, InterproceduralState& interproceduralState)
   at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.Scan(MethodIL methodIL, InterproceduralState& interproceduralState)
   at Mono.Linker.Dataflow.MethodBodyScanner.InterproceduralScan(MethodIL startingMethodIL)
   at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.InterproceduralScan(MethodIL methodIL)
   at Mono.Linker.Steps.MarkStep.MarkReflectionLikeDependencies(MethodIL methodIL, Boolean requiresReflectionMethodBodyScanner, MessageOrigin origin)
   at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason)
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
   at Mono.Linker.Steps.MarkStep.Process()
   at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
   at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at Mono.Linker.Driver.Run(ILogger customLogger)
   at Mono.Linker.Driver.Main(String[] args)
Build continuing because "ContinueOnError" on the task "ILLink" is set to "ErrorAndContinue".
Target ILLink:
1>Microsoft.NET.ILLink.targets(96,5): Error NETSDK1144 : Optimizing assemblies for size failed.
@Qonstrukt Qonstrukt added the bug label Mar 20, 2025
@howitzergamesllc
Copy link

I am seeing the same. It seems to only effect macOS release builds and iOS debug/release builds. Current workaround was to downgrade to ReactiveUI version 20.1.63.

@DevEddy
Copy link

DevEddy commented Apr 16, 2025

Same here, can confirm the workaround.

@HeinA
Copy link

HeinA commented May 7, 2025

Same here aswell

@glennawatson
Copy link
Contributor

Likely an issue when we swapped over to having the attributes, and not having the linker xml anymore. Likely the solution will be at least for the moment bring that xml file back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants