Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageCropper.Forms is not working in ios platform (System.MissingMethodException) #43

Open
sreejithsree139 opened this issue Jan 21, 2021 · 0 comments

Comments

@sreejithsree139
Copy link

I am using ImageCropper.Forms package for cropping images. It is working fine on the android part but when I try it on ios, I am getting the below exception:

Exception:>System.MissingMethodException: Method not found: System.Threading.Tasks.Task`1<Plugin.Media.Abstractions.MediaFile> Plugin.Media.Abstractions.IMedia.TakePhotoAsync(Plugin.Media.Abstractions.StoreCameraMediaOptions)
at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:84
at Stormlion.ImageCropper.ImageCropper.Show (Xamarin.Forms.Page page, System.String imageFile) [0x00033] in <548dc893a11b47fe908c9c3d7f4a39ba>:0
at ImageCropDemo.MainPage.OnClickedRectangle (System.Object sender, System.EventArgs e) [0x00002] in /Users/companyname/Downloads/ImageCropDemo/ImageCropDemo/ImageCropDemo/MainPage.xaml.cs:29

My Code

try
{
	new ImageCropper()
	{
		Success = (imageFile) =>
		{
			Device.BeginInvokeOnMainThread(() =>
			{
				image.Source = ImageSource.FromFile(imageFile);
			});
		}
	}.Show(this);
}
catch (Exception ex)
{
	System.Diagnostics.Debug.WriteLine("Exception:>" + ex);
}

I tried to install ImageCropper.Forms.Fix.v3 to solve this issue. When I try to install Fix.v3 getting the below errors:

Severity Code Description Project File Line Suppression State
Error NU1101 Unable to find package Plugin.Persmissions. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget.org ImageCropDemo C:\Users\user\Downloads\ImageCropDemo\ImageCropDemo\ImageCropDemo\ImageCropDemo.csproj 1=
Error Package restore failed. Rolling back package changes for 'ImageCropDemo'.

The ImageCropper.Forms.Fix.v5 installation is success, but no change in the exception. ImageCropper.Forms.Fix.v6 and ImageCropper.Forms.Fix.v7 packages are also available, which package will solve this issue in ios?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant