Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When I try to build the APK Following shows in the debug console. Build: Build Failed with an exception

/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.3.8/lib/src/datetime_picker_theme.dart:6:28: Error: Type 'DiagnosticableMixin' not found. class DatePickerTheme with DiagnosticableMixin { ^^^^^^^^^^^^^^^^^^^ /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26: Error: Type 'DiagnosticableMixin' not found. class PictureStream with DiagnosticableMixin { ^^^^^^^^^^^^^^^^^^^ /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:44: Error: Type 'DiagnosticableMixin' not found. abstract class PictureStreamCompleter with DiagnosticableMixin { ^^^^^^^^^^^^^^^^^^^ /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.3.8/lib/src/datetime_picker_theme.dart:6:7: Error: The type 'DiagnosticableMixin' can't be mixed in. class DatePickerTheme with DiagnosticableMixin { ^ /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:7: Error: The type 'DiagnosticableMixin' can't be mixed in. class PictureStream with DiagnosticableMixin { ^ /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:16: Error: The type 'DiagnosticableMixin' can't be mixed in. abstract class PictureStreamCompleter with DiagnosticableMixin { ^ /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:167:11: Error: Superclass has no method named 'debugFillProperties'. super.debugFillProperties(properties); ^^^^^^^^^^^^^^^^^^^ /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:171:30: Error: The method 'toStringShort' isn't defined for the class 'PictureStreamCompleter'.

  • 'PictureStreamCompleter' is from 'package:flutter_svg/src/picture_stream.dart' ('/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart'). Try correcting the name to the name of an existing method, or defining a method named 'toStringShort'. ifPresent: _completer?.toStringShort(), ^^^^^^^^^^^^^ /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:266:11: Error: Superclass has no method named 'debugFillProperties'. super.debugFillProperties(description); ^^^^^^^^^^^^^^^^^^^

FAILURE: Build failed with an exception.

  • Where: Script 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 896

  • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\src\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 1m 12s Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)

like image 806
Ahmed ashraf Avatar asked Aug 08 '20 01:08

Ahmed ashraf


3 Answers

dependency_overrides: flutter_svg: 0.18.0

in your pubspec.yaml

like image 175
Nicks Avatar answered Oct 17 '22 05:10

Nicks


I had the exact same error like you did and the solution for me was to update my flutter_svg packages to its latest version. So I recommand you to go into your pubspec.yaml and do following under dependencies:

flutter_svg: 0.18.0

Then run pub get and hopefully the error should disappear.

like image 28
Christian X Avatar answered Oct 17 '22 03:10

Christian X


To change dependency:

 flutter_svg: ^0.17.4  to flutter_svg: ^0.18.0

Then,

flutter pub get
flutter clean

Then, Run

like image 5
Ranjith Bobby Avatar answered Oct 17 '22 03:10

Ranjith Bobby