Xamarin.forms 是什么导致我的Xamarin.Android网格自定义呈现程序引发此异常?

Xamarin.forms 是什么导致我的Xamarin.Android网格自定义呈现程序引发此异常?,xamarin.forms,xamarin.android,Xamarin.forms,Xamarin.android,例外情况是: System.MissingMethodException Constructor on type 'MyApp.Droid.MyGridRenderer' not found 自定义渲染器: using System; using Android.Content; using Android.Graphics; using Android.Text; using Android.Util; using MyApp; using MyApp.Droid; using Xamari

例外情况是:

System.MissingMethodException
Constructor on type 'MyApp.Droid.MyGridRenderer' not found
自定义渲染器:

using System;
using Android.Content;
using Android.Graphics;
using Android.Text;
using Android.Util;
using MyApp;
using MyApp.Droid;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

[assembly: ExportRenderer(typeof(Grid), typeof(MyGridRenderer))]
namespace MyApp.Droid
{
    public class MyGridRenderer : ViewRenderer<Grid, Android.Views.View>
    {
        protected MyGridRenderer(Context context) : base(context)
        {
        }
    }
}
使用系统;
使用Android.Content;
使用Android.Graphics;
使用Android.Text;
使用Android.Util;
使用MyApp;
使用MyApp.Droid;
使用Xamarin.Forms;
使用Xamarin.Forms.Platform.Android;
[assembly:ExportRenderer(typeof(Grid),typeof(MyGridRenderer))]
名称空间MyApp.Droid
{
公共类MyGridRenderer:ViewRenderer
{
受保护的MyGridRenderer(上下文):基本(上下文)
{
}
}
}
我有适用于Mac 7.3.2版的Visual Studio社区

以防万一,这是iOS的自定义渲染器,在没有任何构造函数的情况下工作正常:

using System;
using CoreGraphics;
using CoreText;
using Foundation;
using MyApp;
using MyApp.iOS;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;

[assembly: ExportRenderer(typeof(Grid), typeof(MyGridRenderer))]
namespace MyApp.iOS
{
    public class MyGridRenderer : ViewRenderer<Grid, UIView>
    {
    }
}
使用系统;
使用核心图形;
使用核心文本;
使用基础;
使用MyApp;
使用MyApp.iOS;
使用UIKit;
使用Xamarin.Forms;
使用Xamarin.Forms.Platform.iOS;
[assembly:ExportRenderer(typeof(Grid),typeof(MyGridRenderer))]
名称空间MyApp.iOS
{
公共类MyGridRenderer:ViewRenderer
{
}
}

在最新版本(2.5.0)的Xamarin表单中,Android自定义呈现器的构造函数签名已更改,以要求传递上下文

这不是iOS所需要的

尝试将受保护更改为公共