diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/MarshalMethodsNativeAssemblyGenerator.cs b/src/Xamarin.Android.Build.Tasks/Utilities/MarshalMethodsNativeAssemblyGenerator.cs index d83208521e5..5c94e9b6e27 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/MarshalMethodsNativeAssemblyGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/MarshalMethodsNativeAssemblyGenerator.cs @@ -463,7 +463,13 @@ string MangleForJni (string name) } if (jniType == '[') { - idx++; + // Arrays of arrays (any rank) are bound as a simple pointer, which makes the generated code much simpler (no need to generate pointers to + // pointers to pointers etc), especially that we don't need to dereference these pointers in generated code, we simply pass them along to + // the managed land after all. + while (signature[idx] == '[') { + idx++; + } + jniType = signature[idx]; if (jniArrayTypeMap.TryGetValue (jniType, out managedType)) { if (jniType == 'L') {