Sarah Rahman
Sarah Rahman

Reputation: 203

flutter_svg 0.19.1 not compatible with flutter_plugin_pdf_viewer

I need to use SVG images into my design and I came across the flutter_svg package.

But after adding it to my pubspec.yaml and running pub get, I'm getting this error.

Because flutter_plugin_pdf_viewer <1.0.7 depends on flutter_cache_manager ^0.3.2 which depends on path_provider ^0.5.0+1, flutter_plugin_pdf_viewer <1.0.7 requires path_provider ^0.5.0+1. And because flutter_plugin_pdf_viewer >=1.0.7 depends on flutter_advanced_networkimage ^0.5.0, every version of flutter_plugin_pdf_viewer requires path_provider ^0.5.0+1 or flutter_advanced_networkimage ^0.5.0. And because flutter_advanced_networkimage >=0.5.0-alpha.3 <0.6.0-alpha.1 depends on flutter_svg ^0.13.0 and myapp depends on path_provider ^1.6.18, every version of flutter_plugin_pdf_viewer requires flutter_svg ^0.13.0. So, because myapp depends on both flutter_plugin_pdf_viewer any and flutter_svg ^0.19.1, version solving failed.

pub get failed (1; So, because myapp depends on both flutter_plugin_pdf_viewer any and flutter_svg ^0.19.1, version solving failed.)

So, I changed the flutter_svg package version to 0.13.0 based on the error and pub get ran successfully.

But when I try to run the app I'm getting a different error.

../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.13.1/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments. PictureStream(); ^^^^^^^^^^^^^ ../../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.13.1/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments. abstract class PictureStreamCompleter extends Diagnosticable { ^

FAILURE: Build failed with an exception.

  • Where: Script '/Users/sarahrahman/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 904

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

Process 'command '/Users/sarahrahman/Developer/flutter/bin/flutter'' 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 40s Exception: Gradle task assembleDebug failed with exit code 1

Appreciate any suggestions that can help me with this issue! Thanks!

Upvotes: 0

Views: 1036

Answers (1)

Shirsh Shukla
Shirsh Shukla

Reputation: 5993

As see your error "Because flutter_plugin_pdf_viewer <1.0.7 depends on flutter_cache_manager....... ."

Your project added many library and they are not compatible with this version(that library use flutter version)

So as simple words for using this library,

You will use this library this way(means dont set any verion),

flutter_svg : 

Not this way,

flutter_svg : 0.19.1

Upvotes: 4

Related Questions