diff --git a/src/Mono.Android/Android.Runtime/JNIEnv.cs b/src/Mono.Android/Android.Runtime/JNIEnv.cs index 8b004855ba8..d09c14c840c 100644 --- a/src/Mono.Android/Android.Runtime/JNIEnv.cs +++ b/src/Mono.Android/Android.Runtime/JNIEnv.cs @@ -170,6 +170,10 @@ public static unsafe void FinishCreateInstance (IntPtr instance, IntPtr jclass, public static unsafe IntPtr StartCreateInstance (Type type, string jniCtorSignature, JValue* constructorParameters) { + if (type.IsGenericTypeDefinition) { + throw new NotSupportedException ( + "Constructing instances of generic types from Java is not supported, as the type parameters cannot be determined."); + } return AllocObject (type); }