hnvn / flutter_image_cropper

A Flutter plugin for Android and iOS supports cropping images
988 stars 386 forks source link

Method Not Found "ImageCropper.cropImage" #315

Open ImmortalKDN1 opened 2 years ago

ImmortalKDN1 commented 2 years ago

Hi I don't know what is going on, my code was working fine 2 weeks ago. And now I have this error. Please Help Me!

Running Gradle task 'assembleRelease'...

  File temp2 = await ImageCropper.cropImage(

                                  ^^^^^^^^^

lib/screens/create_event.dart:678:40: Error: Method not found: 'ImageCropper.cropImage'.

  final temp2 = await ImageCropper.cropImage(

                                   ^^^^^^^^^

lib/screens/manage_event.dart:1245:40: Error: Method not found: 'ImageCropper.cropImage'.

  final temp2 = await ImageCropper.cropImage(

                                   ^^^^^^^^^

FAILURE: Build failed with an exception.

Script '/buildtools/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1005

Execution failed for task ':app:compileFlutterBuildRelease'.

Process 'command '/buildtools/flutter/bin/flutter'' finished with non-zero exit value 1

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

BUILD FAILED in 2m 49s

Running Gradle task 'assembleRelease'... 169.7s

Gradle task assembleRelease failed with exit code 1

campcoxconsultants commented 2 years ago

cropImage is no longer a static to the class. I would think await ImageCropper().cropImage( ... would work. I did not take a look to see if that was a desired change or not, because for silly reasons, I only needed my project to build.

kqureshi14 commented 2 years ago

ImageCropper() latest version is not available on Stable, please advise ? to handle this issue ?

Aanu1995 commented 2 years ago

It is available. image_cropper: ^1.5.0

ImmortalKDN1 commented 2 years ago

ImageCropper().cropImage(

Indeed! It's working when using ImageCropper().cropImage(.... Thank you!

campcoxconsultants commented 2 years ago

1.4.1 to 1.5.0 should not have a breaking change per the versioning guidelines, this affects anyone using cropImage with ^1.4.1 or earlier versions of 1.x.x

maxlapides commented 2 years ago

1.4.1 to 1.5.0 should not have a breaking change per the versioning guidelines, this affects anyone using cropImage with ^1.4.1 or earlier versions of 1.x.x

I agree. Since there is a breaking change, the major version number should be incremented.

quickratio commented 2 years ago

Same issue, has anyone found a solution or are we just downgrading back to 1.4.1? thanks.