flutterdartgradlepubspec

Pub/Cache/hosted/pub.dev Error after update Flutter to 3.13.3


I recently update my Flutter app from Flutter 3.0.4 to Flutter 3.13.3.

To do this:

And now I have multiple same errors in logs, like :


[MY PATH]/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.4.2+2/lib/src/widgets/selection/gesture_detector_builder.dart:186:20: Error: The argument type 'void Function(TapDownDetails)' can't be assigned to the parameter type 'void Function(TapDragDownDetails)?'.
 - 'TapDownDetails' is from 'package:flutter/src/gestures/tap.dart' ('[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/gestures/tap.dart').
 - 'TapDragDownDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
        onTapDown: onTapDown,

                   ^

What I did before ask help on Stack Overflow :

I deleted my pubspeck.lock and my .gradle I made a flutter pub cache repair Next, I flutter clean && flutter pub get

So now, my issue is still the same...


Flutter doctor

[√] Flutter (Channel stable, 3.13.3, on Microsoft Windows [version 10.0.19045.3324], locale fr-FR)
    • Flutter version 3.13.3 on channel stable at [MY PATH]\app-flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2524052335 (6 days ago), 2023-09-06 14:32:31 -0700
    • Engine revision b8d35810e9
    • Dart version 3.1.1
    • DevTools version 2.25.0

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at [MY PATH]\AppData\Local\Android\Sdk
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = [MY PATH]\AppData\Local\Android\sdk\platform-tools\adb.exe
    • ANDROID_SDK_ROOT = [MY PATH]\AppData\Local\Android\sdk\platform-tools\adb.exe
    • Java binary at: C:\Program Files\Android\Android Studio1\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.3.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.3.32901.215
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.59.1)
    • VS Code at [MY PATH]\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.25.0

[√] Connected device (4 available)
    • KB2005 (mobile)   • f07efc46 • android-arm64  • Android 13 (API 33)
    • Windows (desktop) • windows  • windows-x64    • Microsoft Windows [version 10.0.19045.3324]
    • Chrome (web)      • chrome   • web-javascript • Google Chrome 116.0.5845.188
    • Edge (web)        • edge     • web-javascript • Microsoft Edge 116.0.1938.69

[√] Network resources
    • All expected network resources are available.

• No issues found!

My app build.gradle informations :

compileSdkVersion 33 minSdkVersion 21 targetSdkVersion 33

My build.gradle version :

ext.kotlin_version = '1.6.21' classpath 'com.android.tools.build:gradle:4.1.0'

**My complete logs error: **

Launching lib\main.dart on KB2005 in debug mode...
Running Gradle task 'assemble[APP]Debug'...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
/[MY PATH]/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.4.2+2/lib/src/widgets/selection/gesture_detector_builder.dart:186:20: Error: The argument type 'void Function(TapDownDetails)' can't be assigned to the parameter type 'void Function(TapDragDownDetails)?'.
 - 'TapDownDetails' is from 'package:flutter/src/gestures/tap.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/gestures/tap.dart').
 - 'TapDragDownDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
        onTapDown: onTapDown,
                   ^
/[MY PATH]/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.4.2+2/lib/src/widgets/selection/gesture_detector_builder.dart:190:24: Error: The argument type 'void Function(TapUpDetails)' can't be assigned to the parameter type 'void Function(TapDragUpDetails)?'.
 - 'TapUpDetails' is from 'package:flutter/src/gestures/tap.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/gestures/tap.dart').
 - 'TapDragUpDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
        onSingleTapUp: onSingleTapUp,
                       ^
/[MY PATH]/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.4.2+2/lib/src/widgets/selection/gesture_detector_builder.dart:195:26: Error: The argument type 'void Function(TapDownDetails)' can't be assigned to the parameter type 'void Function(TapDragDownDetails)?'.
 - 'TapDownDetails' is from 'package:flutter/src/gestures/tap.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/gestures/tap.dart').
 - 'TapDragDownDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
        onDoubleTapDown: onDoubleTapDown,
                         ^
/[MY PATH]/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.4.2+2/lib/src/widgets/selection/gesture_detector_builder.dart:196:31: Error: The argument type 'void Function(DragStartDetails)' can't be assigned to the parameter type 'void Function(TapDragStartDetails)?'.
 - 'DragStartDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/gestures/drag_details.dart').
 - 'TapDragStartDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
        onDragSelectionStart: onDragSelectionStart,
                              ^
/[MY PATH]/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.4.2+2/lib/src/widgets/selection/gesture_detector_builder.dart:197:32: Error: The argument type 'void Function(DragStartDetails, DragUpdateDetails)' can't be assigned to the parameter type 'void Function(TapDragUpdateDetails)?'.
 - 'DragStartDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/gestures/drag_details.dart').
 - 'DragUpdateDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/gestures/drag_details.dart').
 - 'TapDragUpdateDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
        onDragSelectionUpdate: onDragSelectionUpdate,
                               ^
/[MY PATH]/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.4.2+2/lib/src/widgets/selection/gesture_detector_builder.dart:198:29: Error: The argument type 'void Function(DragEndDetails)' can't be assigned to the parameter type 'void Function(TapDragEndDetails)?'.
 - 'DragEndDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/gestures/drag_details.dart').
 - 'TapDragEndDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
        onDragSelectionEnd: onDragSelectionEnd,
                            ^
/[MY PATH]/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart:82:55: Error: A value of type 'RenderObject?' can't be assigned to a variable of type 'AbstractNode?'.
 - 'RenderObject' is from 'package:flutter/src/rendering/object.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/rendering/object.dart').
 - 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/foundation/node.dart').
      final AbstractNode? targetParent = renderObject.parent;
                                                      ^
/[MY PATH]/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart:83:58: Error: The method 'markNeedsPlacement' isn't defined for the class 'AbstractNode?'.
 - 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/foundation/node.dart').
Try correcting the name to the name of an existing method, or defining a method named 'markNeedsPlacement'.
      if (targetParent is RenderLayoutGrid) targetParent.markNeedsPlacement();
                                                         ^^^^^^^^^^^^^^^^^^
/[MY PATH]/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart:84:54: Error: The method 'markNeedsLayout' isn't defined for the class 'AbstractNode?'.
 - 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/foundation/node.dart').
Try correcting the name to the name of an existing method, or defining a method named 'markNeedsLayout'.
      if (targetParent is RenderObject) targetParent.markNeedsLayout();
                                                     ^^^^^^^^^^^^^^^
/[MY PATH]/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart:132:55: Error: A value of type 'RenderObject?' can't be assigned to a variable of type 'AbstractNode?'.
 - 'RenderObject' is from 'package:flutter/src/rendering/object.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/rendering/object.dart').
 - 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/foundation/node.dart').
      final AbstractNode? targetParent = renderObject.parent;
                                                      ^
/[MY PATH]/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart:133:58: Error: The method 'markNeedsPlacement' isn't defined for the class 'AbstractNode?'.
 - 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/foundation/node.dart').
Try correcting the name to the name of an existing method, or defining a method named 'markNeedsPlacement'.
      if (targetParent is RenderLayoutGrid) targetParent.markNeedsPlacement();
                                                         ^^^^^^^^^^^^^^^^^^
/[MY PATH]/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart:134:54: Error: The method 'markNeedsLayout' isn't defined for the class 'AbstractNode?'.
 - 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('/[MY PATH]/app-flutter/flutter/packages/flutter/lib/src/foundation/node.dart').
Try correcting the name to the name of an existing method, or defining a method named 'markNeedsLayout'.
      if (targetParent is RenderObject) targetParent.markNeedsLayout();
                                                     ^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* Where:
Script '[MY PATH]\app-flutter\flutter\packages\flutter_tools\gradle\src\main\groovy\flutter.groovy' line: 1297

* What went wrong:
Execution failed for task ':app:compileFlutterBuild[APP]Debug'.
> Process 'command '[MY PATH]\app-flutter\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 11s
Exception: Gradle task assemble[APP]Debug failed with exit code 1

What I did before ask help on Stack Overflow :

I deleted my pubspeck.lock and my .gradle I made a flutter pub cache repair Next, I flutter clean && flutter pub get

So now, my issue is still the same...


Solution

  • Try to update flutter_math_fork and flutter_layout_grid to latest version. change version code to flutter_math_fork: ^0.7.1 and flutter_layout_grid: ^2.0.5 in your pubspec.yaml, then run flutter pub get. Some api from those libraries may changed, you need to using them in their new ways.