From 81005397736dc53f5732526ebbfcdaa978b28b9d Mon Sep 17 00:00:00 2001 From: Simon Rozsival Date: Fri, 3 Jul 2026 11:12:56 +0200 Subject: [PATCH] [Java.Interop] Keep transitive System.IO.Hashing out of tool output Microsoft.SourceLink.GitHub 10.0.300 is a build-time only package (PrivateAssets="All"), but its dependency Microsoft.Build.Tasks.Git 10.0.300 brings System.IO.Hashing 10.0.8 in as a runtime asset. JI tools and libraries that reference System.IO.Hashing only transitively (class-parse, generator, jcw-gen, logcat-parse, param-name-importer, Java.Interop.Tools.Generator, Java.Interop.Tools.Maven) therefore ship a System.IO.Hashing 10.0.8 assembly. These are staged into the shared .NET for Android SDK pack tools/ directory alongside the build tasks (Xamarin.Android.Build.Tasks, Microsoft.Android.Build.BaseTasks) which reference System.IO.Hashing 10.0.9 directly. Because System.IO.Hashing bumps its AssemblyVersion on every patch (10.0.0.8 vs 10.0.0.9), the single System.IO.Hashing.dll that wins in tools/ can mismatch what the build tasks were compiled against, producing MissingMethodException on System.IO.Hashing.Crc64.Hash at build time (surfaced as error XACRP7000 from AndroidComputeResPaths via Files.HashBytes). Since these tools do not use System.IO.Hashing themselves, exclude SourceLink's runtime assets so the unused 10.0.8 assembly is never emitted. Source linking is unaffected (it runs via SourceLink build assets, not runtime assets); the build tasks keep their direct 10.0.9 reference. Note: external/xamarin-android-tools needs the same change for Xamarin.Android.Tools.AndroidSdk, which floats to 10.0.8 the same way. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- external/Java.Interop/Directory.Build.targets | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/external/Java.Interop/Directory.Build.targets b/external/Java.Interop/Directory.Build.targets index 2da41427e38..bae15432a97 100644 --- a/external/Java.Interop/Directory.Build.targets +++ b/external/Java.Interop/Directory.Build.targets @@ -34,7 +34,18 @@ - + +