[net8.0] Update dependencies from xamarin/xamarin-android - #12520
Conversation
…uild main-cc70ce20aff6934532a8cb6a7bddbf3710fd7e1c-1 Microsoft.Android.Sdk.Windows From Version 34.0.0-preview.1.50 -> To Version 34.0.0-preview.1.110 Dependency coherency updates Microsoft.Dotnet.Sdk.Internal,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100 From Version 8.0.100-alpha.1.22526.2 -> To Version 8.0.100-alpha.1.22622.3 (parent: Microsoft.Android.Sdk.Windows
|
This is blocked by a .NET SDK / workload manifest issue: We have folders like: But this is still in place: It ignores |
|
Things are weirdly broken now: There is no It's actually |
I'm getting some bananas errors otherwise!
|
This would happen if the android dll somehow got that namespace. Are you able to diff the monodroid dll or maybe some extra dependency that this bump brings in? |
|
No, there isn't a I found removing |
Should solve some build errors in `netstandard2.0` projects.
…uild main-c92ae5eb9fdcb3a2fd7c20f5b42dddf8b3ea781a-1 Microsoft.Android.Sdk.Windows From Version 34.0.0-preview.1.50 -> To Version 34.0.0-preview.1.113 Dependency coherency updates Microsoft.Dotnet.Sdk.Internal,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100 From Version 8.0.100-alpha.1.22526.2 -> To Version 8.0.100-alpha.1.22622.3 (parent: Microsoft.Android.Sdk.Windows
|
Ok, we found the cause is dotnet/android@dc3ccf2. The namespace comes from: @dellis1972 is going to look into it. |
This reverts commit 764762a.
This reverts commit 623a63c.
…uild main-8c24b8ff0b32e198311b75e3bbce904989504f7c-1 Microsoft.Android.Sdk.Windows From Version 34.0.0-preview.1.50 -> To Version 34.0.0-preview.1.114 Dependency coherency updates Microsoft.Dotnet.Sdk.Internal,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100 From Version 8.0.100-alpha.1.22526.2 -> To Version 8.0.100-alpha.1.22622.3 (parent: Microsoft.Android.Sdk.Windows
…mespace (#7681) Context: dc3ccf2 Context: dotnet/maui#12520 (comment) Context: https://discord.com/channels/732297728826277939/732297837953679412/1062137297438519296 Context: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0002 Consider this C# fragment: namespace Android.Content { public class Intent { } } namespace Microsoft.Maui.Example { public class Helper { public static void UseIntent (Android.Content.Intent intent) {} } } Given a C# *namespace_or_type_name* such as `Android.Content.Intent`, [ECMA 334 §7.8.1][0] will be used to determine what the type refers to, resolving it to the Assembly-Qualified Name `Android.Content.Intent, Mono.Android`. All is good. However, once dc3ccf2 enters the picture, we now have: // via dc3ccf2 & _Microsoft.Android.Resource.Designer.dll namespace Microsoft.Android.Resource.Designer { public class Resource { } } namespace Android.Content { public class Intent { } } namespace Microsoft.Maui.Example { public class Helper { // CS0234 on the following line: public static void UseIntent (Android.Content.Intent intent) {} } } …and it fails to build with [error CS0234][1]: error CS0234: The type or namespace name 'Content' does not exist in the namespace 'Microsoft.Android' (are you missing an assembly reference?) This only happens if the usage of `Android.Content.Intent` happens *within* a `Microsoft.`-prefixed namespace. Which is most of MAUI. The cause of the error is that while attempting to resolve `Android.Content.Intent`, search starts from the *current* namespace `Microsoft.Maui.Example`, and the compiler will attempt to resolve the types: * `Microsoft.Maui.Example.Android.Content.Intent` (because we're in the `Microsoft.Maui.Example` namespace.) * `Microsoft.Maui.Android.Content.Intent` (because `Microsoft.Maui` is a parent namespace) * `Microsoft.Android.Content.Intent` (because `Microsoft` is a parent parent namespace) These are the *only* types that are resolved, and none of those exist. This results in the CS0234 error. There are two workarounds that the "offending" code can employ: 1. Use `global`: namespace Microsoft.Maui.Example { public class Helper { public static void UseIntent (global::Android.Content.Intent intent) {} } } 2. Add a `using Android.Content` and use `Intent` using Android.Content; namespace Microsoft.Maui.Example { public class Helper { public static void UseIntent (Intent intent) {} } } Both of these require changing things *outside* of xamarin-android. Rephrasing & simplifying: commit dc3ccf2 constitutes an *API break*, as code which *previously* compiled *no longer compiles*. Fix this by updating the `<GenerateResourceDesignerAssembly/>` task to emit types into the `_Microsoft.Android.Resource.Designer` namespace; note `_` prefix. No One™ should have their code in a `_Microsoft.*` namespace, so this shouldn't break anybody. Additionally, update `_Microsoft.Android.Resource.Designer.dll` so that [`EditorBrowsableAttribute`][2] is placed on all the types, a'la: namespace _Microsoft.Android.Resource.Designer; [EditorBrowsable (EditorBrowsableState.Never)] public partial class Resource { } // In App project builds [EditorBrowsable (EditorBrowsableState.Never)] internal partial class ResourceConstant { } Finally, update the Source Compatibility types so that the `Resource` type disables the IDE0002 warning: namespace %CompatibilityNamespace% { #pragma warning disable IDE0002 public partial class Resource : _Microsoft.Android.Resource.Designer.Resource { } #pragma warning restore IDE0002 } [0]: https://github.com/dotnet/csharpstandard/blob/standard-v6/standard/basic-concepts.md#78-namespace-and-type-names [1]: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs0234 [2]: https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.editorbrowsableattribute?view=net-7.0 [3]: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0002
…uild main-639b216d2405f727fbb4d9da0b818da2078896ee-1 Microsoft.Android.Sdk.Windows From Version 34.0.0-preview.1.50 -> To Version 34.0.0-preview.1.119 Dependency coherency updates Microsoft.Dotnet.Sdk.Internal,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100 From Version 8.0.100-alpha.1.22526.2 -> To Version 8.0.100-alpha.1.22622.3 (parent: Microsoft.Android.Sdk.Windows
These are already ignored, it looks like they just added new error codes in .NET 8.
It appears the analyzer can't tell these values are using `OperatingSystem.IsAndroidVersionAtLeast()`. It seems we can just use this API directly instead.
…39d30f Conflicts: .github/DEVELOPMENT.md src/Controls/src/Core/Platform/Android/Resource.designer.cs
d60fc5c to
080ca07
Compare
This has the fix: dotnet/android@22f10b2
…uild main-baa5a739b957d724df3a33f001e4e1cde914cee5-1 Microsoft.Android.Sdk.Windows From Version 34.0.0-preview.1.50 -> To Version 34.0.0-preview.1.126 Dependency coherency updates Microsoft.Dotnet.Sdk.Internal,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100 From Version 8.0.100-alpha.1.22526.2 -> To Version 8.0.100-alpha.1.23063.11 (parent: Microsoft.Android.Sdk.Windows
…uild main-c1efcb5678c8d93c4d5bdd0452a79a8ffab2f6b7-1 Microsoft.Android.Sdk.Windows From Version 34.0.0-preview.1.50 -> To Version 34.0.0-preview.1.127 Dependency coherency updates Microsoft.Dotnet.Sdk.Internal,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100 From Version 8.0.100-alpha.1.22526.2 -> To Version 8.0.100-alpha.1.23063.11 (parent: Microsoft.Android.Sdk.Windows
* Update dependencies from https://github.com/xamarin/xamarin-macios build 20230109.10 Microsoft.MacCatalyst.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.84-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230111.1 Microsoft.MacCatalyst.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.104-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230113.41 Microsoft.MacCatalyst.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.118-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230116.13 Microsoft.MacCatalyst.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.119-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230117.4 Microsoft.MacCatalyst.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.121-net8-p1 * `darc update-dependencies --id 163188` * `darc update-dependencies --id 163187` * `darc update-dependencies --id 163184` * Bump to .NET SDK 8.0.100-alpha.1.22622.3 * HACK: copy folder to microsoft.net.workload.mono.toolchain.net8 * Revert "HACK: copy folder to microsoft.net.workload.mono.toolchain.net8" This reverts commit a7c620c. * Revert "Bump to .NET SDK 8.0.100-alpha.1.22622.3" This reverts commit af663d7. * Bump to Microsoft.CodeAnalysis.NetAnalyzers 8.0.0-preview1.23067.2 Context: https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet8/NuGet/Microsoft.CodeAnalysis.NetAnalyzers/overview/8.0.0-preview1.23067.2 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230118.5 Microsoft.tvOS.Sdk From Version 16.1.585-net8-p1 -> To Version 16.1.910-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230118.5 Microsoft.MacCatalyst.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.122-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230118.5 Microsoft.macOS.Sdk From Version 13.0.1140-net8-p1 -> To Version 13.1.122-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230118.5 Microsoft.iOS.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.122-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230118.32 Microsoft.tvOS.Sdk From Version 16.1.585-net8-p1 -> To Version 16.1.911-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230118.32 Microsoft.MacCatalyst.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.123-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230118.32 Microsoft.macOS.Sdk From Version 13.0.1140-net8-p1 -> To Version 13.1.123-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230118.32 Microsoft.iOS.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.123-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230120.5 Microsoft.tvOS.Sdk From Version 16.1.585-net8-p1 -> To Version 16.1.912-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230120.5 Microsoft.iOS.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.124-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230120.5 Microsoft.MacCatalyst.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.124-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230120.5 Microsoft.macOS.Sdk From Version 13.0.1140-net8-p1 -> To Version 13.1.124-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230120.14 Microsoft.tvOS.Sdk From Version 16.1.585-net8-p1 -> To Version 16.1.913-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230120.14 Microsoft.MacCatalyst.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.125-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230120.14 Microsoft.iOS.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.125-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230120.14 Microsoft.macOS.Sdk From Version 13.0.1140-net8-p1 -> To Version 13.1.125-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230123.5 Microsoft.tvOS.Sdk From Version 16.1.585-net8-p1 -> To Version 16.1.915-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230123.5 Microsoft.MacCatalyst.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.127-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230123.5 Microsoft.macOS.Sdk From Version 13.0.1140-net8-p1 -> To Version 13.1.127-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230123.5 Microsoft.iOS.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.127-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230123.4 Microsoft.tvOS.Sdk From Version 16.1.585-net8-p1 -> To Version 16.1.914-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230123.4 Microsoft.MacCatalyst.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.126-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230123.4 Microsoft.macOS.Sdk From Version 13.0.1140-net8-p1 -> To Version 13.1.126-net8-p1 * Update dependencies from https://github.com/xamarin/xamarin-macios build 20230123.4 Microsoft.iOS.Sdk From Version 16.1.585-net8-p1 -> To Version 16.2.126-net8-p1 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
This reverts commit 694f346.
Fixes:
src\Controls\tests\Core.UnitTests\ImageButtonUnitTest.cs(215,6): error CA2200: Re-throwing caught exception changes stack information
|
@Eilon are you able to review as a member of It's probably the Android/iOS API changes in BlazorWebView. |
|
/azp run MAUI-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
) Context: dc3ccf2 Context: dotnet/maui#12520 When `_Microsoft.Android.Resource.Designer.dll` is used (dc3ccf2) and [`$(AndroidGenerateResourceDesigner)`][0]=False, the `__Microsoft.Android.Resource.Designer.cs` file is still generated, which is *equivalent* to `Resource.designer.cs`. This causes a `Resource` type to be generated. This showed up when attempting to bump MAUI to use xamarin-android for .NET 8 (dotnet/maui#12520), which [introduced][1] *lots* of `*.Resource` types which are *not desirable*. Fix this so that when `$(AndroidGenerateResourceDesigner)`=False the `__Microsoft.Android.Resource.Designer.*` files are *not* created. This prevents `*.Resource` types from being added to the assembly. Note that `_Microsoft.Android.Resource.Designer.dll` is still created at build time. A unit test has been updated to test this change. [0]: https://learn.microsoft.com/en-us/xamarin/android/deploy-test/building-apps/build-properties#androidgenerateresourcedesigner [1]: dotnet/maui@2e49812
Changes: dotnet/android@8a20803...c1efcb5 Changes: dotnet/macios@df0151d...6b1b9f3 Changes: dotnet/installer@8c1708f...9962c6a Changes: dotnet/runtime@5108757...5da4a9e Changes: dotnet/emsdk@aecb1c7...66b9845 Updates: * Microsoft.Android.Sdk.Windows: from 34.0.0-preview.1.50 to 34.0.0-preview.1.127 * Microsoft.iOS.Sdk: from 16.1.585-net8-p1 to 16.2.126-net8-p1 * Microsoft.Dotnet.Sdk.Internal: from 8.0.100-alpha.1.22526.2 to 8.0.100-alpha.1.23063.11 * Microsoft.NETCore.App.Ref: from 8.0.0-alpha.1.22524.5 to 8.0.0-alpha.1.23058.2 * Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100: from 8.0.0-alpha.1.22510.1 to 8.0.0-alpha.1.22620.1 ~~ Workloads ~~ The .NET SDK has a workaround for `microsoft.net.workload.mono.toolchain`: dotnet/sdk@f5cb7e3 * HACK: copy folder to `microsoft.net.workload.mono.toolchain.net8` for now until this is resolved. ~~ Android ~~ The biggest changes now in xamarin-android/main are: * Android enums now have appropriate `[SupportedOSPlatform]` attributes. This caused various new warnings in MAUI. Example: src/Essentials/test/DeviceTests/Tests/Vibration_Tests.cs(16,62): error CA1416: This call site is reachable on: 'Android' 21.0 and later. 'BuildVersionCodes.M' is only supported on: 'android' 23.0 and later. src/Essentials/test/DeviceTests/Tests/Vibration_Tests.cs(34,62): error CA1416: This call site is reachable on: 'Android' 21.0 and later. 'BuildVersionCodes.M' is only supported on: 'android' 23.0 and later. * Android now has a new implementation of `Resource.designer.cs`: dotnet/android@dc3ccf2 We had to make various API changes for a new `Resource` type. Some we we be able to get rid of in the future, after we get: dotnet/android#7721 * Remove IsMarshmallowOrNewer, IsNougatOrNewer It appears the analyzer can't tell these values are using `OperatingSystem.IsAndroidVersionAtLeast()`. It seems we can just use this API directly instead. * Allow `$(AndroidEnableMarshalMethods)` again This has the fix: dotnet/android@22f10b2 Fixes: #11605 ~~ Other changes ~~ * [essentials, compatibility] disable trimming for netstandard * Minor iOS API Changes * Fix CA2200 in test Fixes: src\Controls\tests\Core.UnitTests\ImageButtonUnitTest.cs(215,6): error CA2200: Re-throwing caught exception changes stack information Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
Fixes #11605
Fixes #11481
This pull request updates the following dependencies
Coherency Updates
The following updates ensure that dependencies with a CoherentParentDependency
attribute were produced in a build used as input to the parent dependency's build.
See Dependency Description Format
From https://github.com/xamarin/xamarin-android