dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.93k stars 531 forks source link

`MicrosoftIntune` test fails on .NET 9 #8548

Open jonathanpeppers opened 11 months ago

jonathanpeppers commented 11 months ago

Android application type

.NET Android (net7.0-android, net8.0-android, etc.)

Affected platform version

.NET 9

Description

Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=8749461&view=ms.vss-test-web.build-test-results-tab&runId=89641486&resultId=100000&paneView=attachments Context: https://github.com/xamarin/xamarin-android/pull/8366

The MicrosoftIntune test fails in both Debug and Release mode with:

/Users/runner/.nuget/packages/microsoft.intune.maui.essentials.android/10.0.0-beta2/build/netstandard2.0/Microsoft.Intune.Maui.Essentials.android.targets(208,9): /Users/runner/work/1/s/bin/Release/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.android-x64/9.0.0-alpha.1.23577.7/runtimes/android-x64/native/libSystem.Security.Cryptography.Native.Android.jar doesn't contain /Users/runner/.nuget/packages/ and the mamified library won't be placed in the correct intune directory. This is not expected. [/Users/runner/work/1/a/TestRelease/11-30_21.20.10/temp/MicrosoftIntuneFalse/UnnamedProject.csproj]

Steps to Reproduce

Run the Intune test on .NET 9.

Did you find any workaround?

Will ignore this test for now.

Relevant log output

Intune.zip

jonpryor commented 3 months ago

But wait, it's worse now: dotnet new android project with $(TargetFramework)=net9.0-android and the following additional NuGet packages:

  <ItemGroup>
    <PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.6.1.6" />
    <PackageReference Include="Microsoft.Intune.Maui.Essentials.android" Version="10.0.0" />
  </ItemGroup>

Microsoft.Intune.Maui.Essentials.android v10.0 is the current latest version of the package.

Build, and it immediately fails to build:

$HOME/.nuget/packages/microsoft.intune.maui.essentials.android/10.0.0/build/netstandard2.0/Microsoft.Intune.Maui.Essentials.android.targets(159,9): error : Intune currently supports a maximum Xamarin.Android SDK major version of 34. Your major version is 35. Please downgrade your app's target framework.

This check can be disabled by setting the $(IntuneValidateAndroidBuild) MSBuild property to false:

dotnet build -v:diag -p:IntuneValidateAndroidBuild=false

which then fails with the originally reported error:

$HOME.nuget/packages/microsoft.intune.maui.essentials.android/10.0.0/build/netstandard2.0/Microsoft.Intune.Maui.Essentials.android.targets(208,9): error : …/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.android-arm/9.0.0-rc.1.24380.7/runtimes/android-arm/native/libSystem.Security.Cryptography.Native.Android.jar doesn't contain $HOME/.nuget/packages/ and the mamified library won't be placed in the correct intune directory. This is not expected.

jonathanpeppers commented 3 months ago

@meghandaly is .NET 9 support coming soon for Microsoft.Intune.Maui.Essentials.android?