Eugene Rozental
Eugene Rozental

Reputation: 107

Flutter Errors when recently upgraded

I was getting some weird flutter errors so i googled them and was told to upgrade flutter which didnt seem to help. I didn't touch any of these files, is this a bug? It was working fine a little bit ago. I've tried flutter clean, flutter upgrade, flutter doctor and flutter pub cache repair Here's flutter doctor:


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 3.6)
[!] IntelliJ IDEA Ultimate Edition (version 2019.2)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.42.1)
[√] Connected device (1 available)

! Doctor found issues in 1 category.
Compiler message:
../flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.9.1/lib/flushbar_route.dart:273:8: Error: The method 'FlushbarRoute.install' has more required arguments than those of overridden method 'OverlayRoute.install'.
  void install(OverlayEntry insertionPoint) {
       ^
../flutter/packages/flutter/lib/src/widgets/routes.dart:40:8: Context: This is the overridden method ('install').
  void install() {
       ^

Compiler message:
../flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.9.1/lib/flushbar_route.dart:273:8: Error: The method 'FlushbarRoute.install' has more required arguments than those of overridden method 'OverlayRoute.install'.
  void install(OverlayEntry insertionPoint) {
       ^
../flutter/packages/flutter/lib/src/widgets/routes.dart:40:8: Context: This is the overridden method ('install').
  void install() {
../flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.9.1/lib/flushbar_route.dart:281:18: Error: Too many positional arguments: 0 allowed, but 1 found.
Try removing the extra positional arguments.
    super.install(insertionPoint);
                 ^
../flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.9.1/lib/flushbar_route.dart:281:18: Error: Too many positional arguments: 0 allowed, but 1 found.
Try removing the extra positional arguments.
    super.install(insertionPoint);
                 ^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\-----\Documents\Flutt\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 833

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\-----\Documents\Flutt\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 assembleDebug failed with exit code 1'''../flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.9.1/lib/flushbar_route.dart:281:18: Error: Too many positional arguments: 0 allowed, but 1 found.
Try removing the extra positional arguments.
    super.install(insertionPoint);
                 ^
../flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.9.1/lib/flushbar_route.dart:281:18: Error: Too many positional arguments: 0 allowed, but 1 found.
Try removing the extra positional arguments.
    super.install(insertionPoint);
                 ^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\-----\Documents\Flutt\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 833

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\-----\Documents\Flutt\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 assembleDebug failed with exit code 1

Upvotes: 1

Views: 3105

Answers (3)

Maruata
Maruata

Reputation: 41

Seems to be (in very rare case) unstable plugins or flutter.

I suggest you shift to stable flutter channel (if on dev or beta)

flutter channel stable

and apply flutter upgrade

flutter upgrade

Here even though you are writing upgrade, you can always get the stable latest release. This solve my case. Hope this helps.

Upvotes: 1

Isaac
Isaac

Reputation: 61

In my case the suggested edit to pubspec.yaml caused a version collision with one of the dependencies. I just added a reference to a stable old version of flushbar in the dependencies section in pubspec.yaml

    dependencies:
        flushbar: 1.9.1

Upvotes: 6

Henok
Henok

Reputation: 3383

The problem seems to have been caused by flushbar_route plugin.

Try editing flushbar-1.9.1/lib/flushbar_route.dart which is located at

"%YOURFLUTTERPATH% .pub-cache\hosted\pub.dartlang.org\flushbar-1.9.1\lib\flushbar_route.dart"

Line 273
void install() {

And line 281
super.install();

or the second fix is putting the line below in your pubspec.yaml file

flushbar:
    git:
      url: git://github.com/valterh4ck3r/flushbar
      ref: master

Source : Check this for more .

Upvotes: 4

Related Questions