From 6f9bc6b20927eb64800e4b42cf43f8e52b0b1a73 Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Tue, 20 Jul 2021 18:45:23 -0400 Subject: [PATCH] [Mono.Android.Export] Fix DynamicDependency to JavaArray (#6105) For awhile, we've been observing ILLink warnings: ILLink warning IL2036: Java.Interop.DynamicInvokeTypeInfo.ToNative(CodeExpression): Unresolved type 'Android.Runtime.JavaArray' in DynamicDependencyAttribute The cause is a "typo" in commit 15269f6f, which added the `[DynamicDependency]` custom attributes to `DynamicInvokeTypeInfo.ToNative()`: commit 15269f6f specified the non-generic type `Android.Runtime.JavaArray`, which does not exist. Fix the `[DynamicDependency]` custom attribute value to instead mention ``Android.Runtime.JavaArray`1``, the type `JavaArray`. This should fix the IL2036 warning. --- src/Mono.Android.Export/CallbackCode.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mono.Android.Export/CallbackCode.cs b/src/Mono.Android.Export/CallbackCode.cs index 2aedbdb8004..dafd6fba0d7 100644 --- a/src/Mono.Android.Export/CallbackCode.cs +++ b/src/Mono.Android.Export/CallbackCode.cs @@ -407,7 +407,7 @@ public CodeExpression FromNative (CodeExpression arg) } // Ignore ToNative() overload that takes generic instancing mapping. The reflected method should have nothing to do with it. - [DynamicDependency ("ToLocalJniHandle", "Android.Runtime.JavaArray", "Mono.Android")] + [DynamicDependency ("ToLocalJniHandle", "Android.Runtime.JavaArray`1", "Mono.Android")] [DynamicDependency ("ToLocalJniHandle", "Android.Runtime.JavaCollection", "Mono.Android")] [DynamicDependency ("ToLocalJniHandle", "Android.Runtime.JavaCollection`1", "Mono.Android")] [DynamicDependency ("ToLocalJniHandle", "Android.Runtime.JavaDictionary", "Mono.Android")]