diff --git a/src/Mono.Android/Android.Runtime/JNIEnvInit.cs b/src/Mono.Android/Android.Runtime/JNIEnvInit.cs index 2e8898e4616..32604d970da 100644 --- a/src/Mono.Android/Android.Runtime/JNIEnvInit.cs +++ b/src/Mono.Android/Android.Runtime/JNIEnvInit.cs @@ -58,16 +58,11 @@ static void PropagateUncaughtException (IntPtr env, IntPtr javaThread, IntPtr ja } [UnmanagedCallersOnly] + [RequiresUnreferencedCode ("Uses reflection to load types and register native methods, which may require access to members that could be trimmed. Ensure the necessary types and members are preserved.")] static unsafe void RegisterJniNatives (IntPtr typeName_ptr, int typeName_len, IntPtr jniClass, IntPtr methods_ptr, int methods_len) { - // FIXME: https://github.com/xamarin/xamarin-android/issues/8724 - [UnconditionalSuppressMessage ("Trimming", "IL2057", Justification = "Type should be preserved by the MarkJavaObjects trimmer step.")] - [return: DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods | DynamicallyAccessedMemberTypes.NonPublicNestedTypes)] - static Type TypeGetType (string typeName) => - Type.GetType (typeName, throwOnError: false); - string typeName = new string ((char*) typeName_ptr, 0, typeName_len); - var type = TypeGetType (typeName); + var type = Type.GetType (typeName, throwOnError: false); if (type == null) { RuntimeNativeMethods.monodroid_log (LogLevel.Error, LogCategories.Default,