-
Notifications
You must be signed in to change notification settings - Fork 56
[build] try multi-targeting .NET 8 and 9 #1148
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
Conversation
This reverts commit bc6ab0f.
generated\androidx.emoji2.emoji2-emojipicker\androidx.emoji2.emoji2-emojipicker.csproj : error NU1102: Unable to find package Xamarin.AndroidX.Emoji2 with version (>= 1.2.0.3 && < 1.2.1)
Context: #1148 Context: https://www.nuget.org/packages/Xamarin.AndroidX.Emoji2/1.2.0.2 When multi-targeting .NET 8 and 9, I got the error: generated\androidx.emoji2.emoji2-emojipicker\androidx.emoji2.emoji2-emojipicker.csproj : error NU1102: Unable to find package Xamarin.AndroidX.Emoji2 with version (>= 1.2.0.3 && < 1.2.1) `Xamarin.AndroidX.Emoji2` version 1.2.0.3 doesn't actually exist?!? I am not 100% sure why this failed when adding .NET 9, as the block in `config.json` seems wrong: "nugetVersion": "1.2.0.3", We should just fix this in `main`, as it will cause some other issue down the line.
Context: #1148 Context: https://www.nuget.org/packages/Xamarin.AndroidX.Emoji2/1.2.0.2 When multi-targeting .NET 8 and 9, I got the error: generated\androidx.emoji2.emoji2-emojipicker\androidx.emoji2.emoji2-emojipicker.csproj : error NU1102: Unable to find package Xamarin.AndroidX.Emoji2 with version (>= 1.2.0.3 && < 1.2.1) `Xamarin.AndroidX.Emoji2` version 1.2.0.3 doesn't actually exist?!? I am not 100% sure why this failed when adding .NET 9, as the block in `config.json` seems wrong: "nugetVersion": "1.2.0.3", We should just fix this in `main`, as it will cause some other issue down the line.
On the build output of this PR, I ran:
Results in about ~452 errors: apidiff.txt |
Looks like these ~452 errors are the same for net10.0-android: |
After reviewing an example:
This is due to .NET 8 binding "private" Kotlin constructors, we hide them in .NET 9+: Now we are left with a more reasonable set:
|
API compat errors
|
Context: dotnet/maui#28997 Context: #1148 .NET 10 binding assemblies have changes to generate better code to support trimming and NativeAOT scenarios. We want to ship a copy of .NET 10 assemblies alongside their `net8.0-android` counterparts. To verify API compatibility between the `net8.0-android` and `net10.0-android` assemblies you can run: dotnet tool install --global Microsoft.DotNet.ApiCompat.Tool Get-Item *.nupkg | ForEach-Object { Write-Output "apicompat package $_" ; & apicompat package $_.Name 2>&1 | ForEach-Object { "$_" } } > apidiff.txt At first, we saw ~452 errors, but all appear to be due to changes toward "hiding" internal Kotlin members in .NET 9: * dotnet/java-interop@06214ff General list of changes: * Update `_PackageLevelCustomizations.cshtml` * metadata + Additions cleanup for net10.0 * `nuget.config` from dotnet/android added * <CheckEolWorkloads>false</CheckEolWorkloads> needed to work around some warnings and errors * Create nuget-install.cake * Provision `platforms/android-34` * `Update Metadata.xml` obj/Controls.DeviceTests/Debug/net10.0-android/android/src/mono/androidx/recyclerview/widget/RecyclerView_ItemAnimator_ItemAnimatorListenerImplementor.java(8,57): javac error JAVAC0000: error: ItemAnimatorListener is not public in ItemAnimator; cannot be accessed from outside package * [build] remove `Install extra Android SDK packages` * `$(AndroidManifestType)=GoogleV2` Warning : Dependency `platforms;android-36` should have been installed but could not be resolved. You can attempt to install it with... * Restore BaseOnOffsetChangedListener metadata.xml javac.exe error JAVAC0000: error: BaseOnOffsetChangedListener cannot be inherited with different arguments: <com.google.android.material.appbar.AppBarLayout> and <> * Fix javac error for `ActivityChooserModel` Xamarin.Android.Javac.targets(161,5): error XAJVC0000: C:\a\_work\1\s\artifacts\obj\Benchmarks.Droid\Release\net10.0-android\android-arm64\android\src\mono\androidx\appcompat\widget\ActivityChooserModel_OnChooseActivityListenerImplementor.java:8: error: package androidx.appcompat.widget.ActivityChooserModel does not exist Xamarin.Android.Javac.targets(161,5): error XAJVC0000: androidx.appcompat.widget.ActivityChooserModel.OnChooseActivityListener Xamarin.Android.Javac.targets(161,5): error XAJVC0000: ^ Co-authored-by: Peter Collins <pecolli@microsoft.com> Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
Closing in favor of: #1169 |
Context: #1118
This is a step to narrow down the API breaks in #1118.
I want to find out if any of them occur between .NET 8 and .NET 9.