binSaed / flutter_cached_pdfview

Enhanced PDF view for Flutter.
https://pub.dev/packages/flutter_cached_pdfview
MIT License
121 stars 70 forks source link

Error in Android System, when I test in emulator or real device. #9

Closed Romavic closed 4 years ago

Romavic commented 4 years ago

I am to test in android system. When I test the app on the emulator or real device, the view does not show the pdf.

Appears this error

D/com.shockwave.pdfium.PdfiumCore( 3943): Starting PdfiumAndroid 1.9.0 E/MethodChannel#flutter/platform_views( 3943): Failed to handle method call E/MethodChannel#flutter/platform_views( 3943): java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference E/MethodChannel#flutter/platform_views( 3943): at io.endigo.plugins.pdfviewflutter.FlutterPDFView.getBoolean(FlutterPDFView.java:171) E/MethodChannel#flutter/platform_views( 3943): at io.endigo.plugins.pdfviewflutter.FlutterPDFView.(FlutterPDFView.java:33) E/MethodChannel#flutter/platform_views( 3943): at io.endigo.plugins.pdfviewflutter.PDFViewFactory.create(PDFViewFactory.java:22) E/MethodChannel#flutter/platform_views( 3943): at io.flutter.plugin.platform.SingleViewPresentation.onCreate(SingleViewPresentation.java:179) E/MethodChannel#flutter/platform_views( 3943): at android.app.Dialog.dispatchOnCreate(Dialog.java:389) E/MethodChannel#flutter/platform_views( 3943): at android.app.Dialog.show(Dialog.java:293) E/MethodChannel#flutter/platform_views( 3943): at android.app.Presentation.show(Presentation.java:235) E/MethodChannel#flutter/platform_views( 3943): at io.flutter.plugin.platform.VirtualDisplayController.(VirtualDisplayController.java:94) E/MethodChannel#flutter/platform_views( 3943): at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:47) E/MethodChannel#flutter/platform_views( 3943): at io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView(PlatformViewsController.java:112) E/MethodChannel#flutter/platform_views( 3943): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:95) E/MethodChannel#flutter/platform_views( 3943): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59) E/MethodChannel#flutter/platform_views( 3943): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226) E/MethodChannel#flutter/platform_views( 3943): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/MethodChannel#flutter/platform_views( 3943): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631) E/MethodChannel#flutter/platform_views( 3943): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#flutter/platform_views( 3943): at android.os.MessageQueue.next(MessageQueue.java:323) E/MethodChannel#flutter/platform_views( 3943): at android.os.Looper.loop(Looper.java:136) E/MethodChannel#flutter/platform_views( 3943): at android.app.ActivityThread.main(ActivityThread.java:6077) E/MethodChannel#flutter/platform_views( 3943): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#flutter/platform_views( 3943): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866) E/MethodChannel#flutter/platform_views( 3943): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756) E/flutter ( 3943): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference, null) E/flutter ( 3943): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7) E/flutter ( 3943): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18) E/flutter ( 3943): E/flutter ( 3943): #2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12) E/flutter ( 3943): #3 AndroidViewController._create (package:flutter/src/services/platform_views.dart:633:54) E/flutter ( 3943): #4 AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:550:14) E/flutter ( 3943): #5 RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:175:29) E/flutter ( 3943): #6 RenderAndroidView.performResize (package:flutter/src/rendering/platform_view.dart:156:5) E/flutter ( 3943): #7 RenderObject.layout (package:flutter/src/rendering/object.dart:1746:9) E/flutter ( 3943): #8 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13) E/flutter ( 3943): #9 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7) E/flutter ( 3943): #10 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:171:11) E/flutter ( 3943): #11 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:484:7) E/flutter ( 3943): #12 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:240:7) E/flutter ( 3943): #13 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:399:14) E/flutter ( 3943): #14 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1630:7) E/flutter ( 3943): #15 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:887:18) E/flutter ( 3943): #16 RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:402:19) E/flutter ( 3943): #17 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:884:13) E/flutter ( 3943): #18 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:284:5) E/flutter ( 3943): #19 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1113:15) E/flutter ( 3943): #20 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1052:9) E/flutter ( 3943): #21 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:968:5) E/flutter ( 3943): #22 _rootRun (dart:async/zone.dart:1184:13) E/flutter ( 3943): #23 _CustomZone.run (dart:async/zone.dart:1077:19) E/flutter ( 3943): #24 _CustomZone.runGuarded (dart:async/zone.dart:979:7) E/flutter ( 3943): #25 _invoke (dart:ui/hooks.dart:261:10) E/flutter ( 3943): #26 _drawFrame (dart:ui/hooks.dart:219:3) E/flutter ( 3943): D/ ( 3943): HostConnection::get() New Host Connection established 0x9aa91c80, tid 3955 D/ ( 3943): HostConnection::get() New Host Connection established 0x82734a80, tid 4021 D/ ( 3943): HostConnection::get() New Host Connection established 0x9aa91c00, tid 3952

binSaed commented 4 years ago

update

I found the bug and I working to fix it now

binSaed commented 4 years ago

Fixed it in version flutter_cached_pdfview: ^0.2.1

Romavic commented 4 years ago

@AbdOoSaed In the real phone and in the emulator is working good... Thanks by submit this new release.