-
Notifications
You must be signed in to change notification settings - Fork 52
[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
Draft
jonathanpeppers
wants to merge
8
commits into
main
Choose a base branch
from
dev/peppers/multitarget8and9
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)
jonathanpeppers
added a commit
that referenced
this pull request
May 22, 2025
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.
jonathanpeppers
added a commit
that referenced
this pull request
May 22, 2025
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
|
jonathanpeppers
added a commit
that referenced
this pull request
May 23, 2025
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>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.