diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs index 029cba7d110..ec3eaafd967 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs @@ -224,6 +224,12 @@ void RunReleaseNoLinking (bool useMarshalMethods) LogRunMode ("Release, no linking"); Dictionary resolvers = MakeResolvers (useMarshalMethods); + + // All the RID-agnostic asseemblies will use resolvers of this architecture. This is because the RidAwareInputAssemblySet does not store + // such assemblies separately, but it copies them to **all** the target RIDs. This, in turn, is done because of typemaps and marshal methods + // which process data in a way that requires proper sorting of assemblies per MVID and it requires valid type and method token IDs. + AndroidTargetArch firstArch = resolvers.First ().Key; + resolvers.Add (AndroidTargetArch.None, resolvers[firstArch]); var assemblies = CollectInterestingAssemblies (new RidAwareInputAssemblySet (resolvers.Keys), (AndroidTargetArch arch) => resolvers[arch]); RunReleaseCommon (useMarshalMethods, assemblies, resolvers); }