dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.86k stars 1.68k forks source link

NU1103: Unable to find a stable package runtime.linux-arm.Microsoft.DotNet.ILCompiler with version (>= 8.0.3) #21544

Open voroninp opened 3 months ago

voroninp commented 3 months ago

Description

Well, checking two check boxes breaks the build

Steps to Reproduce

  1. Create Maui App project from a standard template.
  2. Enable Publish Trimed and Publish native AOT
  3. Build
  4. Get the errors

    Error NU1103 Unable to find a stable package runtime.linux-arm.Microsoft.DotNet.ILCompiler with version (>= 8.0.3)

    • Found 2 version(s) in nuget.org [ Nearest version: 9.0.0-preview.1.24080.9 ]

image

Link to public reproduction project repository

No response

Version with bug

8.0.3 GA

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS, Other (Tizen, Linux, etc. not supported by Microsoft directly), I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

Installed workload: 
maui 8.0.7/8.0.100 SDK 8.0.200

dotnet version = 8.0.202
ninachen03 commented 3 months ago

Verified this issue with Visual Studio 17.10.0 Preview 2 (8.0.14). Can repro it. image

voroninp commented 3 months ago

@ninachen03 Yes, I tried both VS and VS preview.

voroninp commented 2 months ago

I just wanted to add that when I disable and trimming, so project file contains:

<PublishTrimmed>False</PublishTrimmed>
<PublishAot>False</PublishAot>

I get the following error when I try to build in Release mode:

XA1030 The 'RunAOTCompilation' MSBuild property is only supported when trimming is enabled. Edit the project file in a text editor to set 'PublishTrimmed' to 'true' for this build configuration. C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.95\tools\Xamarin.Android.Common.targets

As I understand, this line causes the conflict. But the wording is very confusing. You set the default value of <RunAOTCompilation> to true for Android, but Sdk ignores more generic <PublishAot> property.