flutter_image_cropper icon indicating copy to clipboard operation
flutter_image_cropper copied to clipboard

Method Not Found "ImageCropper.cropImage"

Open ImmortalKDN1 opened this issue 2 years ago • 7 comments

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.

  • Where:

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

  • What went wrong:

Execution failed for task ':app:compileFlutterBuildRelease'.

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

  • Try:

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.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2m 49s

Running Gradle task 'assembleRelease'... 169.7s

Gradle task assembleRelease failed with exit code 1

ImmortalKDN1 avatar Feb 21 '22 14:02 ImmortalKDN1

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.

campcoxconsultants avatar Feb 21 '22 16:02 campcoxconsultants

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

kqureshi14 avatar Feb 22 '22 13:02 kqureshi14

It is available. image_cropper: ^1.5.0

Aanu1995 avatar Feb 22 '22 14:02 Aanu1995

ImageCropper().cropImage(

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

ImmortalKDN1 avatar Feb 22 '22 14:02 ImmortalKDN1

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

campcoxconsultants avatar Feb 22 '22 17:02 campcoxconsultants

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.

maxlapides avatar Feb 22 '22 18:02 maxlapides

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

quickratio avatar Mar 02 '22 09:03 quickratio