Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

_CastError was thrown building NotificationListener: Null check operator used on a null value and FlutterPluginPdfViewerPlugin.java uses or overrides a deprecated API. #76

Open
dryasbk opened this issue Aug 11, 2021 · 6 comments

Comments

@dryasbk
Copy link

dryasbk commented Aug 11, 2021

This error when open the PDF in Android only. iOS works fine

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following _CastError was thrown building NotificationListener:
Null check operator used on a null value

The relevant error-causing widget was:
PageView
file:///Users/dryasbk/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/advance_pdf_viewer-2.0.0/lib/
src/viewer.dart:224:20

When the exception was thrown, this was the stack:
#0 _PDFPageState._repaint (package:advance_pdf_viewer/src/page.dart:54:45)
#1 _PDFPageState.didChangeDependencies (package:advance_pdf_viewer/src/page.dart:42:5)
#2 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4732:11)
#3 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4548:5)
#4 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611:14)
#5 Element.updateChild (package:flutter/src/widgets/framework.dart:3360:20)
#6 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6090:14)
#7 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#8 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6090:14)
#9 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#10 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#11 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#12 StatelessElement.update (package:flutter/src/widgets/framework.dart:4655:5)
#13 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#14 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#15 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#16 ProxyElement.update (package:flutter/src/widgets/framework.dart:4922:5)
#17 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#18 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#19 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746:11)
#20 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#21 StatefulElement.update (package:flutter/src/widgets/framework.dart:4778:5)
#22 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#23 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#24 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#25 StatelessElement.update (package:flutter/src/widgets/framework.dart:4655:5)
#26 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#27 SliverMultiBoxAdaptorElement.updateChild (package:flutter/src/widgets/sliver.dart:1241:37)
#28 SliverMultiBoxAdaptorElement.performRebuild.processElement
(package:flutter/src/widgets/sliver.dart:1146:35)
#29 Iterable.forEach (dart:core/iterable.dart:257:30)
#30 SliverMultiBoxAdaptorElement.performRebuild (package:flutter/src/widgets/sliver.dart:1190:24)
#31 SliverMultiBoxAdaptorElement.update (package:flutter/src/widgets/sliver.dart:1124:7)
#32 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#33 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6090:14)
#34 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#35 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#36 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#37 StatelessElement.update (package:flutter/src/widgets/framework.dart:4655:5)
#38 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#39 RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:5596:32)
#40 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6243:17)
#41 _ViewportElement.update (package:flutter/src/widgets/viewport.dart:228:11)
#42 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#43 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6090:14)
#44 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#45 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6090:14)
#46 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
CrossPT#47 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6090:14)
#48 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#49 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6090:14)
#50 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#51 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#52 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746:11)
#53 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#54 StatefulElement.update (package:flutter/src/widgets/framework.dart:4778:5)
CrossPT#55 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#56 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6090:14)
#57 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#58 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#59 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
CrossPT#60 ProxyElement.update (package:flutter/src/widgets/framework.dart:4922:5)
#61 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#62 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6090:14)
#63 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#64 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6090:14)
#65 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#66 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6090:14)
#67 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#68 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6090:14)
#69 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#70 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#71 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#72 StatelessElement.update (package:flutter/src/widgets/framework.dart:4655:5)
#73 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#74 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#75 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746:11)
#76 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#77 StatefulElement.update (package:flutter/src/widgets/framework.dart:4778:5)
#78 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#79 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#80 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746:11)
#81 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#82 StatefulElement.update (package:flutter/src/widgets/framework.dart:4778:5)
#83 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#84 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#85 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#86 StatelessElement.update (package:flutter/src/widgets/framework.dart:4655:5)
#87 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#88 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#89 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746:11)
#90 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#91 StatefulElement.update (package:flutter/src/widgets/framework.dart:4778:5)
#92 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#93 RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:5596:32)
#94 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6243:17)
#95 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#96 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#97 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#98 StatelessElement.update (package:flutter/src/widgets/framework.dart:4655:5)
#99 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#100 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#101 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#102 ProxyElement.update (package:flutter/src/widgets/framework.dart:4922:5)
#103 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#104 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#105 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#106 ProxyElement.update (package:flutter/src/widgets/framework.dart:4922:5)
#107 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#108 RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:5596:32)
#109 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6243:17)
#110 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#111 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#112 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746:11)
#113 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#114 StatefulElement.update (package:flutter/src/widgets/framework.dart:4778:5)
#115 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#116 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#117 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#118 ProxyElement.update (package:flutter/src/widgets/framework.dart:4922:5)
#119 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#120 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#121 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746:11)
#122 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#123 StatefulElement.update (package:flutter/src/widgets/framework.dart:4778:5)
#124 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#125 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6090:14)
#126 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#127 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#128 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#129 StatelessElement.update (package:flutter/src/widgets/framework.dart:4655:5)
#130 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#131 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6090:14)
#132 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#133 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#134 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746:11)
#135 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#136 StatefulElement.update (package:flutter/src/widgets/framework.dart:4778:5)
#137 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#138 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#139 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746:11)
#140 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#141 StatefulElement.update (package:flutter/src/widgets/framework.dart:4778:5)
#142 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#143 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#144 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#145 ProxyElement.update (package:flutter/src/widgets/framework.dart:4922:5)
#146 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#147 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#148 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746:11)
#149 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#150 StatefulElement.update (package:flutter/src/widgets/framework.dart:4778:5)
#151 Element.updateChild (package:flutter/src/widgets/framework.dart:3350:15)
#152 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4599:16)
#153 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746:11)
#154 Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#155 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2582:33)
#156 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:875:21)
#157 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:328:5)
#158 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15)
#159 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1082:9)
#160 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998:5)
#164 _invoke (dart:ui/hooks.dart:163:10)
#165 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259:5)
#166 _drawFrame (dart:ui/hooks.dart:126:31)
(elided 3 frames from dart:async)

Screenshot_1628693121

Also during build get:

Note: /Users/dryasbk/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/advance_pdf_viewer-2.0.0/android/src/main/java/pt/tribeiro/flutter_plugin_pdf_viewer/FlutterPluginPdfViewerPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

@dryasbk
Copy link
Author

dryasbk commented Aug 11, 2021

Add Error started after adding Hive packages.
After when I go back to the copy before Hive it worked fine !!!
Any help?!

@dryasbk
Copy link
Author

dryasbk commented Aug 12, 2021

Changed it to pdf_render: ^1.0.12 , worked fine

@jafar260698
Copy link

I have also the same error , how to handle it ?

@devmaxde
Copy link

Downgrade Flutter

@JmyW
Copy link

JmyW commented Sep 7, 2021

Changed it to pdf_render: ^1.0.12 , worked fine

I changed to pdf_render too, due to NullPointerException issue. The pdf_render works very well.

@a914-gowtham
Copy link

use this package instead pdf_render

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants