jbowmanp1107 / ImageCropper.Maui

MIT License
43 stars 10 forks source link

iOS: SIGABRT: ArgumentNull_Generic Arg_ParamName_Name, image #4

Closed MGohil closed 1 year ago

MGohil commented 1 year ago

When we use this plugin in iOS and test the app in iPhone by giving the Captured image from Camera, it gives `SIGABRT: ArgumentNull_Generic Arg_ParamName_Name, image

Error: Value cannot be null. (Parameter 'image')

` Device: iPhone SE (2nd generation)

Log:

ObjCRuntime.ThrowHelper.ThrowArgumentNullException(String )
ObjCRuntime.NativeObjectExtensions.GetNonNullHandle(INativeObject , String )
Bind_TOCropViewController.TOCropViewController..ctor(TOCropViewCroppingStyle style, UIImage image)
ImageCropper.Maui.PlatformImageCropper.ShowFromFile(ImageCropper imageCropper, String imageFile)
ImageCropper.Maui.ImageCropper.Show(Page page, String imageFile)
ObjCRuntime.Runtime.ThrowException(IntPtr )
UIKit.UIApplication.UIApplicationMain(Int32 , String[] , IntPtr , IntPtr )
UIKit.UIApplication.Main(String[] , Type , Type )
My.App.Program.Main(String[] args)

This is because, I get following exception in ImageCropper.Maui.ImageCropper class

2023-01-24 18:22:03.279 ImageCropperDemo[986:1175024] CapturePhotoAsync THREW: Could not find file '/private/var/containers/Bundle/Application/A81AA6BA-B507-41C9-A924-9428A9BA830B/ImageCropperDemo.app/559f1bf9-06d8-47dd-8b5d-1e5d55210757.png'.

Due to this iOS PlatformImageCropper -> ShowFromFile

UIImage image = UIImage.FromFile(imageFile);

image is null here.

MGohil commented 1 year ago

This change will help fix this issue.

image

MGohil commented 1 year ago

Created the Pull request: https://github.com/jbowmanp1107/ImageCropper.Maui/pull/5

@jbowmanp1107 : Can you please review and merge and release the new package version?

Thanks.

jbowmanp1107 commented 1 year ago

I will review it today :)

jbowmanp1107 commented 1 year ago

1.0.3