-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump to xamarin/monodroid@fb0d5021; StrongName Xamarin.Android.Build.…
…Tasks (#6116) Context: https://discord.com/channels/732297728826277939/732297837953679412/865316625950572554 Context: https://discord.com/channels/732297728826277939/732297837953679412/869307441601470484 Changes: http://github.com/xamarin/monodroid/compare/b359d3b43774ff031add3d7a4949483052957db3...fb0d502139bc222d4e9ad82f912b1c6f1d4ca34e * xamarin/monodroid@fb0d50213: StrongName Xamarin.Android.Build.Debugging.Tasks (#1214) * xamarin/monodroid@71ac9a81b: Bump to xamarin/xamarin-android/main@4ea37883 (#1220) Occasionally when: 1. Building on Windows within Visual Studio, with 2. "Legacy" Xamarin.Android installed, and 3. A preview .NET for Android (net6.0 + Android) workload installed the build may fail: C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\30.0.100-preview.6.62\tools\Xamarin.Android.Common.targets(512,7): error MSB4064: The "ManifestPlaceholders" parameter is not supported by the "GetAndroidPackageName" task loaded from assembly: Xamarin.Android.Build.Tasks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null from the path: D:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll. Verify that the parameter exists on the task, the <UsingTask> points to the correct assembly, and it is a settable public instance property. C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\30.0.100-preview.6.62\tools\Xamarin.Android.Common.targets(509,3): error MSB4063: The "GetAndroidPackageName" task could not be initialized with its input parameters. The root cause of the problem is that *both* "Legacy" Xamarin.Android and .NET SDK for Android contain a non-strong-named `Xamarin.Android.Build.Tasks.dll`, and if a Project Solution `.sln` contains Projects `.csproj` which reference both SDKs, then `Xamarin.Android.Build.Tasks.dll` will only be loaded *once*, which will be incompatible with the other. In the above error message, the legacy `Xamarin.Android.Build.Tasks.dll` was loaded first, causing the build to fail when trying to build the .NET SDK for Android project. There are three ways to solve this: 1. Maintain API compatibility between Legacy & .NET 6+ 2. Use different assembly names between "Legacy" and .NET 6+, or 3. [Strong-name][0] all MSBuild-related assemblies. (1) is a non-starter; new or different functionality is introduced as part of .NET SDK for Android. The assemblies can't be API compatible. We could solve via (2) by renaming the .NET SDK for Android assembly to e.g. `Microsoft.Android.Build.Tasks.dll`, but this only delays the problem; come .NET 7, we'll still have the same assembly name for two different installation locations (.NET 6, .NET 7), and they won't be compatible with each other. Which leaves (3): we strong-name our MSBuild assemblies. Strong-naming allows us to have different versions installed "side by side" (Legacy and .net 6) in separate directories. Strong-naming is the best solution to this issue. A few notes though. 1. `pdb2mdb.exe` is now ILRepacked into `Xamarin.Android.Build.Tasks` via [`ILRepack`][1], as it is not Strong-named. See also 610ade7. 2. The `Xamarin.Android.Build.Tasks.csproj` project itself is *NOT* StrongNamed. This is because `pdb2mdb.exe` is not either. We handle the StrongNaming via the `ILRepacker` target later in the build. The end result is a Strong-named `Xamarin.Android.Build.Tasks.dll`. Co-authored-by: Jonathan Peppers <jonathan.peppers@gmail.com> [0]: https://docs.microsoft.com/en-us/dotnet/standard/assembly/strong-named [1]: https://www.nuget.org/packages/ILRepack/
- Loading branch information
1 parent
77895e2
commit 2d81740
Showing
12 changed files
with
35 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
xamarin/monodroid:main@b359d3b43774ff031add3d7a4949483052957db3 | ||
xamarin/monodroid:main@fb0d502139bc222d4e9ad82f912b1c6f1d4ca34e | ||
mono/mono:2020-02@c633fe923832f0c3db3c4e6aa98e5592bf5a06e7 |
This file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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