Home > Blockchain >  pdf package errors - Flutter
pdf package errors - Flutter

Time:07-16

I am not able to use any of the PDF viewer plugins from pub.dev. Here are the errors I am getting from each one. I am sure that I am missing some kind of setup. (Running on Google Pixel Android)

advance_pdf_viewer Error:

java.lang.IllegalStateException: Already closed    
MissingPluginException(No implementation found for method getPage on channel flutter_plugin_pdf_viewer)

pdf_viewer_plugin Error:

    Execution failed for task ':app:checkDebugDuplicateClasses'.
 A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.8.0-runtime (androidx.core:core:1.8.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
     Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.8.0-runtime (androidx.core:core:1.8.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
     Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.8.0-runtime (androidx.core:core:1.8.0) and support-compat-25.3.1-runtime (com.android.support:support-compat:25.3.1)
     Duplicate class android.support.v4.media.MediaBrowserCompat found in modules media-1.4.1-runtime (androidx.media:media:1.4.1) and support-media-compat-25.3.1-runtime (com.android.support:support-media-compat:25.3.1)
     Duplicate class android.support.v4.media.MediaBrowserCompat$CallbackHandler found in modules media-1.4.1-runtime (androidx.media:media:1.4.1) and support-media-compat-25.3.1-runtime (com.android.support:support-media-compat:25.3.1)
     Duplicate class android.support.v4.media.MediaBrowserCompat$ConnectionCallback found in modules media-1.4.1-runtime (androidx.media:media:1.4.1) and support-media-compat-25.3.1-runtime (com.android.support:support-media-compat:25.3.1)
     Duplicate class android.support.v4.media.MediaBrowserCompat$ConnectionCallback$ConnectionCallbackInternal found in modules media-1.4.1-runtime (androidx.media:media:1.4.1) and support-media-compat-25.3.1-runtime (com.android.support:support-media-compat:25.3.1)

Etc...

syncfusion_flutter_pdfviewer. I had Installed it long ago and it worked. Today I started installing different pdf packages and now it throws errors inside the package files (which I cannot modify). Such as:

WidgetsBinding might be null, should use "?"

Something is wrong with my setup. I can't use any pdf plugin. Please help. Thank you!

Update: pubspec.yaml dependencies

dependencies:
flutter:
  sdk: flutter

cr_calendar:
  git:
    url: https://github.com/TomasWard1/cr_calendar

flutter_vibrate: ^1.3.0
image_picker: ^0.8.5
image_cropper: ^1.5.1
loading_indicator: ^3.0.3
icon_picker: ^2.0.0
pull_to_refresh: ^2.0.0
cached_network_image: ^3.0.0
flutter_gradient_colors: ^2.1.1
firebase_storage: ^10.2.11
firebase_core: ^1.2.0
firebase_database: ^9.0.10
slide_to_act: 2.0.1
firebase_auth: ^3.3.13
google_sign_in: ^5.0.4
flutter_login_facebook: ^1.4.1
shared_preferences: ^2.0.9
apple_sign_in: ^0.1.0
flutter_twitter_login: ^1.1.0
uuid: ^3.0.4
http: ^0.13.0
path_provider: ^2.0.2
intl: 0.17.0
google_mobile_ads: ^1.2.0
provider: ^6.0.1
google_maps_webservice: ^0.0.19
flutter_sound: ^9.1.9
flutter_launcher_icons: ^0.9.2
connectivity_plus: ^2.1.0
internet_connection_checker: ^0.0.1 3
google_fonts: ^2.3.1
any_link_preview: ^2.0.6
badges: ^2.0.2
file_picker: ^4.3.0
overlay_support: ^1.2.1
local_auth: ^1.1.10
rate_my_app: ^1.1.1 1
in_app_review: ^2.0.4
expansion_tile_card: ^2.0.0
flutter_animation_progress_bar: ^2.0.1
flutter_native_splash: ^2.1.3 1
confetti: ^0.6.0
awesome_notifications: ^0.6.21
flutter_iconpicker: ^3.1.2
modal_gif_picker: ^0.0.1
rxdart: ^0.26.0
keyboard_visibility: ^0.5.6
flutter_google_places: ^0.3.0
dependency_validator: ^3.0.0
tuple: ^2.0.0
proste_bezier_curve: ^2.0.2
animated_background: ^2.0.0
photo_view: ^0.14.0
firebase_messaging: ^11.4.4
firebase_analytics: ^9.1.12
flutter_local_notifications: ^9.5.3 1
flutter_native_timezone: ^2.0.0

CodePudding user response:

WidgetsBinding might be null, should use "?"

upgrde you flutter version to latest one

  • Related