36

I am working on a flutter app and project was running perfectly but suddenly project isn't running and it is giving me an error.

Here is the error code i am getting when i try to run app

Compiler message:
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/extended_image-0.7.2/lib/src/gesture/extended_image_slide_page_route.dart:333:9: Error: No named parameter with the name 'animation'.
        animation: animation,
        ^^^^^^^^^
/C:/flutter/packages/flutter/lib/src/cupertino/route.dart:435:3: Context: Found this candidate, but the arguments don't match.
  CupertinoFullscreenDialogTransition({
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.15.0/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
  PictureStream();
  ^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.15.0/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
abstract class PictureStreamCompleter extends Diagnosticable {
               ^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/extended_image-0.7.2/lib/src/gesture/extended_image_slide_page_route.dart:333:9: Error: No named parameter with the name 'animation'.
        animation: animation,                                           
        ^^^^^^^^^
/C:/flutter/packages/flutter/lib/src/cupertino/route.dart:435:3: Context: Found this candidate, but the arguments don't match.
  CupertinoFullscreenDialogTransition({
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.15.0/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
  PictureStream();
  ^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.15.0/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
abstract class PictureStreamCompleter extends Diagnosticable {
               ^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.                                                           

FAILURE: Build failed with an exception.
                                                                        

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\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.

BUILD FAILED in 43s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                        44.9s
Exception: Gradle task assembleDebug failed with exit code 1
Moaaz Mezo
  • 361
  • 1
  • 4
  • 4
  • 1
    Hi Moaaz, please try to include a short description of are trying to do, what led to this error and what you had done to try to fix this error. Nobody knows how to help you if we only see a bunch of error logs. Do give this guide a read: [How to ask](https://stackoverflow.com/help/how-to-ask). – terahertz Apr 03 '20 at 13:54
  • have you found the solution? – Sandeep Apr 13 '20 at 04:54

13 Answers13

46

Try add in your pubsepc.yaml flutter_svg: ^0.17.3+1. For me works

Kheronn
  • 461
  • 3
  • 3
  • 1
    Initially did work when i only just included this **flutter_svg: ^0.17.3+1** file. But this worked for me too, after doing the running a ***"flutter clean"*** command, then included **flutter_svg: ^0.17.3+1** in *pubsepc.yaml* followed by a ***"flutter pub get"*** (don't automatically by the flutter extension in my VSCode IDE) command. – Virtu_Acad May 18 '20 at 18:07
7

Use the latest version of your package (flutter_svg: ^0.18.0)

It works for me

Kaushik Borah
  • 141
  • 1
  • 4
5

First I ran this command

flutter clean

then I added the latest version to my pubspec.yaml file

flutter_svg: ^0.18.0

then I ran the the following command

flutter pub get

then I ran successfully

Mehmet
  • 1,467
  • 1
  • 14
  • 19
4

If you are using extended_image, you may be will need to update it, This is working with me:

extended_image: ^0.7.3-dev

Source

Julian
  • 33,915
  • 22
  • 119
  • 174
Ahmed Sa'eed
  • 173
  • 2
  • 3
  • 12
1

Delete the version number and update the pubsepc.yaml file or Updated versions of the packages

1

This solution worked for me:

https://github.com/inspireui/support/issues/2740#issuecomment-614582990

I just shifted the channel to stable

Sharjeel Ali
  • 1,459
  • 1
  • 11
  • 8
  • Thanks. I was encountering a similar error `../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26: Error: Type 'DiagnosticableMixin' not found.` when running `flutter run --flavor prod`, which I resolved by installing the 'stable' branch of Flutter with `git clone https://github.com/flutter/flutter.git -b stable` (instead of the 'master' or 'beta' branch) and then executing it with `cd flutter; ./flutter/bin/flutter run --flavor prod` – Luke Schoen Aug 03 '20 at 01:57
1

If you still getting error after upgrading package due to dependency of another package - just use the same version flutter_svg-0.15.0, because many of dependent packages are still not upgraded.

Go to you flutter SDK folder - flutter.pub-cache\hosted\pub.dartlang.org\flutter_svg-0.15.0\lib\src

Open picture_stream.dart file and put the below changes.

  1. abstract class PictureStreamCompleter extends Diagnosticable => abstract class PictureStreamCompleter with DiagnosticableMixin

  2. class PictureStream extends Diagnosticable => class PictureStream with DiagnosticableMixin

Above solution is based on this pull request of flutter.

To support both stable and beta channels, I'd suggest that this should be

class PictureStream with DiagnosticableMixin { ... } until DiagnosticableMixin is officially deprecated.

flutter/flutter#50498

then run pub get and run the project.

Above solution will work only if - flutter_svg is not in your current project but in your .pub_cache - so and dependent package you have used in your current project - so this will be solution until DiagnosticableMixin is officially deprecated.

1

Try this:

Start by running a,

  1. "flutter clean" command, then included,
  2. flutter_svg: ^0.17.3+1 in pubsepc.yaml followed by a,
  3. "flutter pub get" command. Then run your code to see if you will still get this error. This was what worked for me
Virtu_Acad
  • 141
  • 1
  • 5
  • Because fstore depends on koukicons 2.0.2 which depends on flutter_svg ^0.15.0, flutter_svg ^0.15.0 is required. So, because fstore depends on flutter_svg ^0.17.3+1, version solving failed. – Pankaj Sakariya Jun 24 '20 at 13:15
0

The animation parameter was split and renamed by github.com/flutter/flutter/pull/50180. Because there apparently are no existing tests that use CupertinoFullscreenDialogTransition, that change did not break any tests and was not deemed to be a breaking change.

I'm working on it how you can resolve this in your existing structure, I'll update you soon for same. Meanwhile just updating you that - It is renamed public API by the team.

  • From the Error: No named parameter with the name 'animation'. error message, it's clear that the CupertinoFullscreenDialogTransition constructor parameters changed. From there I searched the flutter git repository for where CupertinoFullscreenDialogTransition is implemented, ran git blame to see what commit modified the parameter, and looked at its commit description to find the referenced pull request. – Pankaj Sakariya Apr 08 '20 at 09:49
0

I was using flame dependency flame: ^0.17.3 I changed it to the current flame: ^0.20.1 if you are using the flame dependency try that!

Raed Tulefat
  • 671
  • 6
  • 5
0

Upgrade the flutter_svg to the latest version and check if any other package that depends on it doesn't give you any error. If you get another error about the flutter_svg then just comment that package and any other package that depend on flutter_svg and check again

Conrad Mota
  • 101
  • 1
  • 2
0
  1. Upgrade flutter_svg to the latest version in pubsepc.yaml
  2. Then Run the following command in the terminal "flutter pub get"
Alec Fedor
  • 11
  • 1
  • 2
0

This error may occur due to: flutter_svg, extended_image, wechat_assets_picker...

The solution is to upgrade these packages to the latest version.

Doan Bui
  • 3,572
  • 25
  • 36