Skip to content

Commit

Permalink
[Mono.Android.Export] Fix DynamicDependency to JavaArray (#6105)
Browse files Browse the repository at this point in the history
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 15269f6, which added the
`[DynamicDependency]` custom attributes to
`DynamicInvokeTypeInfo.ToNative()`: commit 15269f6 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<T>`.
This should fix the IL2036 warning.
  • Loading branch information
jonpryor committed Jul 20, 2021
1 parent 57636c8 commit 6f9bc6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Mono.Android.Export/CallbackCode.cs
Expand Up @@ -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")]
Expand Down

0 comments on commit 6f9bc6b

Please sign in to comment.