Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ImageCropper.Forms在初始化时失败_C#_Xamarin_Xamarin.forms - Fatal编程技术网

C# ImageCropper.Forms在初始化时失败

C# ImageCropper.Forms在初始化时失败,c#,xamarin,xamarin.forms,C#,Xamarin,Xamarin.forms,我正在尝试使用ImageCropper.Forms,我已经完成了所有步骤,但初始化失败并引发此异常: 未找到方法:System.Threading.Tasks.Task`1 Plugin.Media.Abstracts.IMedia.TakePhotoAsync(Plugin.Media.Abstracts.StoreCameramedOptions) 正如您在下面看到的,我正在执行Official page推荐的所有步骤: 雄激素单 <application android:label=

我正在尝试使用ImageCropper.Forms,我已经完成了所有步骤,但初始化失败并引发此异常:

未找到方法:System.Threading.Tasks.Task`1 Plugin.Media.Abstracts.IMedia.TakePhotoAsync(Plugin.Media.Abstracts.StoreCameramedOptions)

正如您在下面看到的,我正在执行Official page推荐的所有步骤:

雄激素单

<application android:label="MyApp" android:icon="@drawable/favicon96_96">
        <!-- Image cropper activity -->
        <activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity" android:theme="@style/Base.Theme.AppCompat" />
  ...
种植业

public CropperPage()
        {
            InitializeComponent();

            Init();
        }

        async void Init()
        {
            
            new ImageCropper()
            {
                PageTitle = "Cut an image",
                AspectRatioX = 1,
                AspectRatioY = 1,
                CropShape = ImageCropper.CropShapeType.Rectangle,
                SelectSourceTitle = "Select a file",
                TakePhotoTitle = "Take a picture",
                PhotoLibraryTitle = "Pic gallery",
                Success = (imageFile) =>
                {
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        imageView.Source = ImageSource.FromFile(imageFile);
                    });
                }
            }.Show(this);
       }

我做错了什么?

我只需要从Nuget安装ImageCropper.Forms.Fix包,一切都按预期开始工作。

嗨,记得在有时间时标记答案,这将帮助其他有类似问题的人。:-)
public CropperPage()
        {
            InitializeComponent();

            Init();
        }

        async void Init()
        {
            
            new ImageCropper()
            {
                PageTitle = "Cut an image",
                AspectRatioX = 1,
                AspectRatioY = 1,
                CropShape = ImageCropper.CropShapeType.Rectangle,
                SelectSourceTitle = "Select a file",
                TakePhotoTitle = "Take a picture",
                PhotoLibraryTitle = "Pic gallery",
                Success = (imageFile) =>
                {
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        imageView.Source = ImageSource.FromFile(imageFile);
                    });
                }
            }.Show(this);
       }