Error after upgrading flutter from 2.5 to 2.8

Viewed 4631

I upgrade flutter from 2.5 to 2.8 and when I run the app I get the following errors:

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/inspireui-1.0.9/lib/icons/material.dart:5943:25: Error: Member not found: 'six_ft_apart'.
  'six_ft_apart': Icons.six_ft_apart,
                        ^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/inspireui-1.0.9/lib/icons/material.dart:5944:31: Error: Member not found: 'six_ft_apart_sharp'.
  'six_ft_apart_sharp': Icons.six_ft_apart_sharp,
                              ^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/inspireui-1.0.9/lib/icons/material.dart:5945:33: Error: Member not found: 'six_ft_apart_rounded'.
  'six_ft_apart_rounded': Icons.six_ft_apart_rounded,
                                ^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/inspireui-1.0.9/lib/icons/material.dart:5946:34: Error: Member not found: 'six_ft_apart_outlined'.
  'six_ft_apart_outlined': Icons.six_ft_apart_outlined,
                                 ^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/extended_image-5.1.3/lib/src/gesture_detector/scale.dart:32:11: Error: No named parameter with the name 'delta'.
          delta: delta,
          ^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/extended_image-5.1.3/lib/src/gesture_detector/scale.dart:339:43: Error: Too few positional arguments: 2 required, 1 given.
          focalPointDelta > computePanSlop(pointerDeviceKind))
                                          ^
/C:/src/flutter/packages/flutter/lib/src/gestures/events.dart:2116:8: Context: Found this candidate, but the arguments don't match.
double computePanSlop(PointerDeviceKind kind, DeviceGestureSettings? settings) {
       ^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/extended_image-5.1.3/lib/src/gesture_detector/drag.dart:46:66: Error: Too few positional arguments: 2 required, 1 given.
    final double minDistance = minFlingDistance ?? computeHitSlop(kind);
                                                                 ^
/C:/src/flutter/packages/flutter/lib/src/gestures/events.dart:2103:8: Context: Found this candidate, but the arguments don't match.
double computeHitSlop(PointerDeviceKind kind, DeviceGestureSettings? settings) {
       ^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/extended_image-5.1.3/lib/src/gesture_detector/drag.dart:54:55: Error: Too few positional arguments: 2 required, 1 given.
    return _globalDistanceMoved.abs() > computeHitSlop(pointerDeviceKind);
                                                      ^
/C:/src/flutter/packages/flutter/lib/src/gestures/events.dart:2103:8: Context: Found this candidate, but the arguments don't match.
double computeHitSlop(PointerDeviceKind kind, DeviceGestureSettings? settings) {
       ^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/extended_image-5.1.3/lib/src/gesture_detector/drag.dart:101:66: Error: Too few positional arguments: 2 required, 1 given.
    final double minDistance = minFlingDistance ?? computeHitSlop(kind);
                                                                 ^
/C:/src/flutter/packages/flutter/lib/src/gestures/events.dart:2103:8: Context: Found this candidate, but the arguments don't match.
double computeHitSlop(PointerDeviceKind kind, DeviceGestureSettings? settings) {
       ^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/extended_image-5.1.3/lib/src/gesture_detector/drag.dart:109:55: Error: Too few positional arguments: 2 required, 1 given.
    return _globalDistanceMoved.abs() > computeHitSlop(pointerDeviceKind);
                                                      ^
/C:/src/flutter/packages/flutter/lib/src/gestures/events.dart:2103:8: Context: Found this candidate, but the arguments don't match.
double computeHitSlop(PointerDeviceKind kind, DeviceGestureSettings? settings) {
       ^^^^^^^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1070

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' 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 1m 10s
Exception: Gradle task assembleDebug failed with exit code 1
3 Answers

From what I could figure out, they have renamed six_ft_... to six__ft_..., notice the double underscore.

Until they fix it, you can change it manually in your local copy of the package.

The other ones that don't work, just delete them too.

when I upgrade my flutter to 2.8 , it just need to download cmdline-tools from android sdk manager tools. if you still didn't download it , try to download it. then add android-sdk/tools path to the environment

best of luck

When you change between flutter versions, there may be breaking changes, which is the case here.

You may need to upgrade some dependencies of your project, go through each dependency, open them on pub.dev, read the changelog to see what changed and if they have upgraded to support newer flutter versions. Notice that not all dependencies may have issues, but some may.

For instance, extended_image: 5.1.3 stopped working on Flutter version 2.8, cause issues like yours above. So if you upgrade extended_image to v6.0.0, the issue goes away.

You should either move back on a flutter version with flutter downgrade v2.5.3, to whichever version works for you, or check your dependencies.

Related