Inside Flutter I am making a exam test flutter in which , I am adding test page where 70% screen is of pdf and 30% to select option of question but to show pdf on screen I am using advance_pdf_viewer
but on instating plugin. I'm getting version solved error as follows
Because advance_pdf_viewer <1.2.0 depends on flutter_cache_manager ^1.1.3 and advance_pdf_viewer >=1.2.0 <1.2.1 depends on path_provider ^1.6.11, advance_pdf_viewer <1.2.1 requires flutter_cache_manager ^1.1.3 or path_provider ^1.6.11. And because advance_pdf_viewer ^1.2.1 depends on path_provider ^1.6.24, advance_pdf_viewer <2.0.0 requires flutter_cache_manager ^1.1.3 or path_provider ^1.6.11. And because advance_pdf_viewer >=2.0.0 <2.0.1 depends on flutter_cache_manager ^3.0.2 and advance_pdf_viewer >=2.0.1 depends on flutter_cache_manager ^3.3.0, every version of advance_pdf_viewer requires flutter_cache_manager ^1.1.3 or >=3.0.2 <4.0.0 or path_provider ^1.6.11. And because exammers_final depends on cached_network_image ^2.5.1 which depends on flutter_cache_manager ^2.1.0, every version of advance_pdf_viewer requires path_provider ^1.6.11. So, because exammers_final depends on both path_provider ^2.0.11 and advance_pdf_viewer any, version solving failed. pub finished with exit code 65
My Pubspec.yaml
cupertino_icons: ^1.0.2
http: ^0.13.4
fluttertoast: ^8.0.9
rflutter_alert: ^2.0.4
get: ^4.6.3
carousel_slider: ^4.1.1
bloc: ^8.0.3
flutter_bloc: ^8.0.1
get_it: ^7.2.0
sembast: ^3.2.0
provider: ^6.0.3
cached_network_image: ^2.5.1
bottom_navy_bar: ^5.6.0
flutter_svg: ^1.0.3
html: ^0.15.0
flutter_html: ^3.0.0-alpha.5
firebase: ^9.0.3
firebase_auth: ^3.3.19
firebase_core: ^1.16.0
google_sign_in: ^5.3.3
image_picker: ^0.8.5 3
font_awesome_flutter: ^10.1.0
flutter_local_notifications: ^9.5.3 1
readmore: ^2.2.0
flutter_rating_bar: ^4.0.1
razorpay_flutter: ^1.3.1
share_plus: ^4.0.10
image_downloader: ^0.31.0
path_provider: ^2.0.11
CodePudding user response:
What is happening is that your packages are clashing with each other, so what you could do is remove the version specification and then do your flutter pub get, so flutter resolves with the correct versions that would work together properly, then you can go to your pubspec.lock
to get the proper versioning that would not cause an error.
In this case the package you want to install without a version is
advance_pdf_viewer
Then you can get it's workable version from you pubspec.lock
.
I just checked the documentation for
advance_pdf_viewer
and they installed it like this
advance_pdf_viewer: any
CodePudding user response:
if you are using vscode, try Ctrl shift p
then click or search for Pubspec Assist: Add/update deppendancy
and write your package after that.
it automatically install packages, its better to remove unseccessful packages