chore!: Remove some use of [Export]#21199
Conversation
|
Multiple implicit and explicit questions here:
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21199/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21199/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21199/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21199/wasm-skia-net9/index.html |
1 similar comment
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21199/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21199/docs/index.html |
|
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21199/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21199/wasm-skia-net9/index.html |
|
|
Context: unoplatform/uno-private#1422 Context: dotnet/maui@70fbb83 While exploring the use of NativeAOT on Android for .NET 10, a sticking point is that `[Java.Interop.ExportAttribute]` does not "play nice" with NativeAOT; if a class contains an `[Export]` attributed-method, and that class is encountered during runtime, then an exception is thrown: F DOTNET : FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Methods such as __export__ are not implemented! F DOTNET : at Microsoft.Android.Runtime.ManagedTypeManager.RegisterNativeMembers(JniType, Type, ReadOnlySpan`1) + 0x386 F DOTNET : at Java.Interop.ManagedPeer.RegisterNativeMembers(IntPtr jnienv, IntPtr klass, IntPtr n_nativeClass, IntPtr n_methods) + 0x195 This can be worked around for *instance* methods, but not for static methods. Update `ApplicationActivity*.cs` and `NativeApplication.cs` to remove `[Export]`, and update any such attributed methods to throw a `NotSupportedException`. Add a new `UnoWebViewHandlerJavascriptInterface.java` Java class, and update `UnoWebViewHandler.Android.cs` to implement `IUnoWebViewHandlerJavascriptInterface`, a'la dotnet/maui@70fbb835. This removes the use of `[Export]` from `UnoWebViewHandler.Android.cs`. TODO: Review and update other uses of `[Export]`, such as in `UIElement.Android.cs`. BREAKING CHANGE: the following methods now throw `NotSupportedException`: * `Microsoft.UI.Xaml.ApplicationActivity.GetTypeAssemblyFullName(string)` (Android renderer) * `Microsoft.UI.Xaml.ApplicationActivity.GetTypeAssemblyFullName(string)` (Android+Skia renderer) * `Microsoft.UI.Xaml.NativeApplication.GetTypeAssemblyFullName(string)`
The `Uno.UI.Runtime.Skia.Android` build was failing with: C:\a\1\s\src\Uno.UI\UI\Xaml\Controls\WebView\Native\Android\UnoWebViewHandler.Android.cs(6,54): error CS0246: The type or namespace name 'IUnoWebViewHandlerJavascriptInterface' could not be found (are you missing a using directive or an assembly reference?) Update `Uno.UI.Runtime.Skia.Android.csproj` to now reference `Uno.UI.BindingHelper.Android.netcoremobile.csproj`, so that the new `IUnoWebViewHandlerJavascriptInterface` type can be found.
Context: 8f7f7bc **Tests - Templates > \* group_4 > Run Project Template Tests** was failing: Uno56NugetLibrary.csproj : error NU1101: Unable to find package Uno.UI.BindingHelper.Android. No packages exist with this id in source(s): /agent/_work/1/s/.dotnet/library-packs, NuGet official package source, Solution Packages, uno-dev The problem is that there is no `Uno.UI.BindingHelper.Android` NuGet package, nor should there be. The build was looking for one because commit 8f7f7bc added `Uno.UI.BindingHelper.Android` as a `@(PackageReference)` to `Uno.UI.Runtime.Skia.Android.csproj`, but neglected to set [`%(TreatAsPackageReference)`][0]: > Project to Project References Project to Project references will be, > by default, be considered as nuget package references. However, this > behavior can be overridden [by setting `%(TreatAsPackageReference)`=false] Conveniently enough, this is *also* what most of the other `@(PackageReference)`s do! Update `Uno.UI.Runtime.Skia.Android.csproj` so that `Uno.UI.BindingHelper.Android` is *not* treated as a NuGet package. [0]: https://github.com/NuGet/Home/wiki/Adding-nuget-pack-as-a-msbuild-target/df5f292a271a5bdc7347e9e631be3625271d44bc
Context: 73b73b0 Context: 8f7f7bc `Uno.UI.Runtime.Skia.Android.csproj` explicitly adds `UnoWebViewHandler.Android.cs` into `@(Compile)`, which means that any changes to `UnoWebViewHandler.Android.cs` impacts the `Uno.UI.Runtime.Skia.Android.csproj` build. Thus, when 73b73b0 introduced new interface usage within `UnoWebViewHandler.Android.cs`, this broke the build, as `Uno.UI.Runtime.Skia.Android.csproj` didn't know about the new `UnoWebViewHandlerJavascriptInterface` Java type. Commit 8f7f7bc attempted to fix this by adding a `@(ProjectReference)` to `Uno.UI.BindingHelper.Android` into `Uno.UI.Runtime.Skia.Android`. This allowed things to build, but introduced a plethora of NuGet- related errors (0cb3adb) and now file errors: error XALNS7028: System.IO.FileNotFoundException: Could not load assembly 'Uno.UI.BindingHelper.Android, Version=255.255.255.255, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile? Part of the conceptual problem here is that `Uno.UI.Runtime.Skia.Android` uses types from `src/Uno.UI` but not the entire infrastructure. This is why adding `Uno.UI.BindingHelper.Android` as an assembly reference failed: there's too much "extra stuff" going on to prevent things from working. Since the "cause" of the pain is that `Uno.UI.Runtime.Skia.Android` is directly including files from `Uno.UI`, *continue* that path: update `Uno.UI.Runtime.Skia.Android` to import `UnoWebViewHandlerJavascriptInterface.java` as an [`@(AndroidJavaSource)`][0]. This allows `Uno.UI.Runtime.Skia.Android` to contain `IUnoWebViewHandlerJavascriptInterface` -- allowing it to compile -- *without* using `Uno.UI.BindingHelper.Android`. Alas, this requires updating `Uno.UI.Runtime.Skia.Android` to add IDE0055 to `$(NoWarn)`, to ignore: src/Uno.UI.Runtime.Skia.Android/obj/**/generated/src/Uno.UI.IUnoWebViewHandlerJavascriptInterface.cs(6,17): error IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) src/Uno.UI.Runtime.Skia.Android/obj/**/generated/src/__NamespaceMapping__.cs(3,11): error IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) This also requires enabling nullability on `UnoWebViewHandler.Android.cs`, addressing: src/Uno.UI/UI/Xaml/Controls/WebView/Native/Android/UnoWebViewHandler.Android.cs(16,14): error CS8767: Nullability of reference types in type of parameter 'message' of 'void UnoWebViewHandler.PostMessage(string message)' doesn't match implicitly implemented member 'void IUnoWebViewHandlerJavascriptInterface.PostMessage(string? p0)' (possibly because of nullability attributes). [0]: https://learn.microsoft.com/en-us/dotnet/android/building-apps/build-items#androidjavasource
323fd93 to
c0a9b6a
Compare
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21199/docs/index.html |
|
|
|
Rebased atop acd096e, which makes for a known comparison point: https://dev.azure.com/uno-platform/Uno%20Platform/_build/results?buildId=172962&view=results acd096e only shows test failures on Tests - iOS Native and Publish - iOS Testflight. Nothing Android. Compare to the current build, which has various Android-related failures: https://dev.azure.com/uno-platform/Uno%20Platform/_build/results?buildId=173133&view=ms.vss-test-web.build-test-results-tab |
Context: 4d84ee3 Context: dotnet/java-interop#1260 Context: dotnet/maui@70fbb83 Context: dotnet/maui@b1113d5 The `Given_WebView2.When_LocalFolder_File()` test was failing: Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Timed out waiting for condition to be met. When_LocalFolder_File():344 at Private.Infrastructure.TestServices.WindowHelper.WaitFor(Func1 condition, Int32 timeoutMS, String message, String callerMemberName, Int32 lineNumber) at Uno.UI.RuntimeTests.Tests.Microsoft_UI_Xaml_Controls.Given_WebView2.<When_LocalFolder_File>g__Do|7_0() at Uno.UI.RuntimeTests.Helpers.TestHelper.RetryAssert(Func`1 assertion, Int32 count) at Uno.UI.RuntimeTests.Tests.Microsoft_UI_Xaml_Controls.Given_WebView2.When_LocalFolder_File() The timeout confused me for a bit: why would it be timing out? `Given_WebView2.cs:344` provided more context: webView.NavigationCompleted += (sender, e) => navigated = true; … await TestServices.WindowHelper.WaitFor(() => navigated, 3000); `TestServices.WindowHelper.WaitFor()` was timing out, because `navigated` was never set, because the `webView.NavigationCompleted` event was never raised. `webView.NavigationCompleted`, meanwhile, is impacted by the removal of `[Export]` on `UnoWebViewHandler.PostMessage()` in 4d84ee3! Now things are making sense! It turns out that dotnet/maui@70fbb835 did not work, because of dotnet/java-interop#1260: the .NET for Android Java Callable Wrapper generator does not process custom attributes on interface method implementations. Consequently, this: // Java public interface UnoWebViewHandlerJavascriptInterface { void postMessage(String message); } // C# class UnoWebViewHandler : Java.Lang.Object, IUnoWebViewHandlerJavascriptInterface { [JavascriptInterface] public void PostMessage(string? message) => … } ***Did not work***, as the resulting Java Callable Wrapper for `UnoWebViewHandler` did not have `@android.webkit.JavascriptInterface`. The fix for MAUI was in dotnet/maui@b1113d56: use a *`class`*, not an interface: // Java public abstract class UnoWebViewHandlerJavascriptInterface { public abstract void postMessage(String message); } // C# class UnoWebViewHandler : UnoWebViewHandlerJavascriptInterface { [JavascriptInterface] public override void PostMessage(string? message) => … } *This* causes the resulting Java Callable Wrapper to have the necessary `@JavascriptInterface` annotation. This in turn fixes the `Given_WebView2.When_LocalFolder_File()` test.
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21199/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21199/wasm-skia-net9/index.html |
|
The build 173206 found UI Test snapshots differences: Details
|
Context: 4d84ee3 Commit 4d84ee3 noted a BREAKING CHANGE: > BREAKING CHANGE: the following methods now throw `NotSupportedException`: > > * `Microsoft.UI.Xaml.ApplicationActivity.GetTypeAssemblyFullName(string)` > (Android renderer) > * `Microsoft.UI.Xaml.ApplicationActivity.GetTypeAssemblyFullName(string)` > (Android+Skia renderer) > * `Microsoft.UI.Xaml.NativeApplication.GetTypeAssemblyFullName(string)` *Delay* this breaking change so that it's part of the .NET 10 build, not part of *all* supported builds. This will ensure we don't break existing .NET 9 semantics, while allowing .NET 10 to support NativeAOT.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21199/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21199/docs/index.html |
|
The build 173373 found UI Test snapshots differences: Details
|
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 now requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 now requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 now requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. * Update `SamplesApp.UITests.csproj` to explicitly use Microsoft.NET.Test.Sdk 17.14.1, to "override" the nearly four year old Microsoft.NET.Test.Sdk 17.0.0 reference implicitly brought in from Uno.UITest.Helpers/1.1.0-dev.70. This hopefully fixes a `MissingMethodException` for `IFileSystem.Exists(string)` seen on CI: Unhandled exception. System.MissingMethodException: Method not found: 'Boolean Microsoft.Testing.Platform.Helpers.IFileSystem.Exists(System.String)'. at Microsoft.Testing.Extensions.VSTestBridge.Configurations.RunSettingsConfigurationProvider.BuildAsync(CommandLineParseResult commandLineParseResult) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at Microsoft.Testing.Extensions.VSTestBridge.Configurations.RunSettingsConfigurationProvider.BuildAsync(CommandLineParseResult commandLineParseResult) at Microsoft.Testing.Platform.Configurations.ConfigurationManager.BuildAsync(IFileLoggerProvider syncFileLoggerProvider, CommandLineParseResult commandLineParseResult) in /_/src/Platform/Microsoft.Testing.Platform/Configurations/ConfigurationManager.cs:line 37 at Microsoft.Testing.Platform.Hosts.TestHostBuilder.BuildAsync(ApplicationLoggingState loggingState, TestApplicationOptions testApplicationOptions, IUnhandledExceptionsHandler unhandledExceptionsHandler, DateTimeOffset createBuilderStart) in /_/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.cs:line 131 at Microsoft.Testing.Platform.Builder.TestApplicationBuilder.BuildAsync() in /_/src/Platform/Microsoft.Testing.Platform/Builder/TestApplicationBuilder.cs:line 112 at TestingPlatformEntryPoint.Main(String[] args) in /__w/1/s/src/SamplesApp/SamplesApp.UITests/obj/Release/net9.0/TestPlatformEntryPoint.cs:line 14 at TestingPlatformEntryPoint.<Main>(String[] args) TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. * Add new `$(NetPreviousNetCoreApple)` MSBuild property to `Directory.Build.props`, which contains target frameworks for $(NetPrevios) Apple platforms. Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use `$(NetPreviousNetCoreApple)`. This is so that target frameworks are consistent: `net9.0-ios` *floats*; circa a year ago, it aliased `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`. This can make it annoyingly difficult to `[Obsolete]`s consistent across separate project builds. TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. * Add new `$(NetPreviousNetCoreApple)` MSBuild property to `Directory.Build.props`, which contains target frameworks for $(NetPrevios) Apple platforms. Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use `$(NetPreviousNetCoreApple)`. This is so that target frameworks are consistent: `net9.0-ios` *floats*; circa a year ago, it aliased `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`. This can make it annoyingly difficult to `[Obsolete]`s consistent across separate project builds. TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. * Add new `$(NetPreviousNetCoreApple)` MSBuild property to `Directory.Build.props`, which contains target frameworks for $(NetPrevios) Apple platforms. Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh` to provide a "complete" target framework version. This is so that target frameworks are consistent: `net9.0-ios` *floats*; circa a year ago, it aliased `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`. "Even better", this doesn't "flow" to the C# compiler: `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not* `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used! This can make it annoyingly difficult to get `[Obsolete]`s consistent across separate project builds. TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. * Add new `$(NetPreviousNetCoreApple)` MSBuild property to `Directory.Build.props`, which contains target frameworks for $(NetPrevios) Apple platforms. Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh` to provide a "complete" target framework version. This is so that target frameworks are consistent: `net9.0-ios` *floats*; circa a year ago, it aliased `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`. "Even better", this doesn't "flow" to the C# compiler: `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not* `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used! This can make it annoyingly difficult to get `[Obsolete]`s consistent across separate project builds. TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. * Add new `$(NetPreviousNetCoreApple)` MSBuild property to `Directory.Build.props`, which contains target frameworks for $(NetPrevios) Apple platforms. Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh` to provide a "complete" target framework version. This is so that target frameworks are consistent: `net9.0-ios` *floats*; circa a year ago, it aliased `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`. "Even better", this doesn't "flow" to the C# compiler: `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not* `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used! This can make it annoyingly difficult to get `[Obsolete]`s consistent across separate project builds. TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. * Add new `$(NetPreviousNetCoreApple)` MSBuild property to `Directory.Build.props`, which contains target frameworks for $(NetPrevios) Apple platforms. Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh` to provide a "complete" target framework version. This is so that target frameworks are consistent: `net9.0-ios` *floats*; circa a year ago, it aliased `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`. "Even better", this doesn't "flow" to the C# compiler: `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not* `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used! This can make it annoyingly difficult to get `[Obsolete]`s consistent across separate project builds. TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. * Add new `$(NetPreviousNetCoreApple)` MSBuild property to `Directory.Build.props`, which contains target frameworks for $(NetPrevios) Apple platforms. Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh` to provide a "complete" target framework version. This is so that target frameworks are consistent: `net9.0-ios` *floats*; circa a year ago, it aliased `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`. "Even better", this doesn't "flow" to the C# compiler: `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not* `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used! This can make it annoyingly difficult to get `[Obsolete]`s consistent across separate project builds. TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. * Add new `$(NetPreviousNetCoreApple)` MSBuild property to `Directory.Build.props`, which contains target frameworks for $(NetPrevios) Apple platforms. Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh` to provide a "complete" target framework version. This is so that target frameworks are consistent: `net9.0-ios` *floats*; circa a year ago, it aliased `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`. "Even better", this doesn't "flow" to the C# compiler: `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not* `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used! This can make it annoyingly difficult to get `[Obsolete]`s consistent across separate project builds. TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. * Add new `$(NetPreviousNetCoreApple)` MSBuild property to `Directory.Build.props`, which contains target frameworks for $(NetPrevios) Apple platforms. Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh` to provide a "complete" target framework version. This is so that target frameworks are consistent: `net9.0-ios` *floats*; circa a year ago, it aliased `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`. "Even better", this doesn't "flow" to the C# compiler: `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not* `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used! This can make it annoyingly difficult to get `[Obsolete]`s consistent across separate project builds. TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. * Add new `$(NetPreviousNetCoreApple)` MSBuild property to `Directory.Build.props`, which contains target frameworks for $(NetPrevios) Apple platforms. Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh` to provide a "complete" target framework version. This is so that target frameworks are consistent: `net9.0-ios` *floats*; circa a year ago, it aliased `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`. "Even better", this doesn't "flow" to the C# compiler: `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not* `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used! This can make it annoyingly difficult to get `[Obsolete]`s consistent across separate project builds. TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: #19934 Context: #21140 Context: dotnet/sdk#48949 #19934 was the first attempt to build unoplatform/uno with .NET 10. It *built* (mostly), but it had *lots* of unit test failures (over 3700) that were not understood at the time. #21140 was an attempt to cleanup & simplify #19934. It partially succeeded, but required additional reconsideration for a cleaner and more understandable merge. (Later, PR #21183 helped explain many of the unit test failures that PR #19934 observed: Xamarin.UITest doesn't work reliably under .NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!) Some of the contents of #19934 and #21140 have been split out into separately merged PRs such as #21230 (CS0246 fixes) and #21199 (remove `[Export]` in some scenarios). Squash existing "known good" and related changes: * doc updates * Bumping target framework versions, * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7. * `$(TreatWarningsAsErrors)`=true + NuGet warnings. For example: error NU1510: Warning As Error: PackageReference System.Private.Uri will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due to nullability changes, particularly in iOS. * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which @jonpryor was able to fix in a reasonable timeframe, and some of which was thrown into `$(NoWarn)` to deal with later. * Remove hardcoded `$(TargetFramework)`=net8.0 from `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds, and remove other uses of `net8.0` from everywhere other than `src/SolutionTemplate`. * Provide `%(PackageReference.Version)` for packages that were producing NU1015 errors, specifically `Uno.Fonts.OpenSans`. * Remove `@(PackageReference)` values which produced NU1510 warnings such as: warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. * Improve `dotnet-install.yml` use, as some CI environments *don't* have a `unoplatform/uno` checkout, and thus *cannot* copy files such as `build/ci/net10/global.json`. * Improve `local-android-uitest-run.sh` for local macOS use: Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location for whare Emulator images are created. (Not sure what's wrong with my environment, but they are not reliably created or loaded from `$HOME/.android/avd`.) Also update so that it doesn't require running the script from the `build/test-scripts` directory. You can now run it from topdir: UITEST_IS_LOCAL=true \ build/test-scripts/local-android-uitest-run.sh * Provision OpenJDK-17, as .NET 9 requires it. * Use Xcode 16.4, as .NET 10 iOS now requires it. * Add new `$(NetPreviousNetCoreApple)` MSBuild property to `Directory.Build.props`, which contains target frameworks for $(NetPrevios) Apple platforms. Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh` to provide a "complete" target framework version. This is so that target frameworks are consistent: `net9.0-ios` *floats*; circa a year ago, it aliased `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`. "Even better", this doesn't "flow" to the C# compiler: `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not* `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used! This can make it annoyingly difficult to get `[Obsolete]`s consistent across separate project builds. TODO, for future commits to this PR: * Xamarin.AndroidX package version bumps from #21205. We felt that these shouldn't be separately merged, as some of version bumps are quite significant and should instead only be used with .NET 10. * A new understanding of `src/SolutionTemplate`: the intent, as @jonpryor currently understands it, is that tests within `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)` should *not* be updated, etc. Which means that when we drop support for an older version of .NET, we should in turn *remove the old tests*.
Context: https://github.com/unoplatform/uno-private/issues/1422
Context: dotnet/maui@70fbb83
While exploring the use of NativeAOT on Android for .NET 10, a sticking point is that
[Java.Interop.ExportAttribute]does not "play nice" with NativeAOT; if a class contains an[Export]attributed-method, and that class is encountered during runtime, then an exception is thrown:This can be worked around for instance methods, but not for static methods.
Update
ApplicationActivity*.csandNativeApplication.csto remove[Export], and update any such attributed methods to throw aNotSupportedException.Add a new
UnoWebViewHandlerJavascriptInterface.javaJava class, and updateUnoWebViewHandler.Android.csto implementIUnoWebViewHandlerJavascriptInterface, a'la dotnet/maui@70fbb835. This removes the use of[Export]fromUnoWebViewHandler.Android.cs.TODO: Review and update other uses of
[Export], such as inUIElement.Android.cs.BREAKING CHANGE: the following methods now throw
NotSupportedException:Microsoft.UI.Xaml.ApplicationActivity.GetTypeAssemblyFullName(string)(Android renderer)Microsoft.UI.Xaml.ApplicationActivity.GetTypeAssemblyFullName(string)(Android+Skia renderer)Microsoft.UI.Xaml.NativeApplication.GetTypeAssemblyFullName(string)GitHub Issue: closes #
PR Type:
What is the current behavior? 🤔
What is the new behavior? 🚀
PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information ℹ️