Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin error should be catchable #14

Closed
Tahaan opened this issue Oct 16, 2019 · 7 comments
Closed

Plugin error should be catchable #14

Tahaan opened this issue Oct 16, 2019 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@Tahaan
Copy link

Tahaan commented Oct 16, 2019

Package name
A name of package whom this bug concerns. Ex. native_pdf_renderer

Describe the bug
On error in the package the entire app crashes and closes.

To Reproduce
Steps to reproduce the behavior:

  1. ListView.builder
  2. Returns a Card with a FutureBuilder in the ListView which returns an "Image" as a thumbnail of a FILE BASED PDF file (downloaded from the internet to INTERNAL STORAGE)
  3. Scroll rapidly down a long list
  4. The problem is intermittend but happens often

Expected behavior
Throw a catchable exception

Screenshots
N/A

Smartphone (please complete the following information):

  • Device: Android Emulator API 28
  • OS: Android 9
  • Version [28]

Additional context
Below 3 items that worked OK before the next one caused the error.

D/PDF_RENDER( 3424): OpenFileDocument. File: /data/user/0/za.co.mydomain.myapp/app_flutter/Cache/d503a6e1-4be2-4f33-9504-eb4072c26afb.pdf
D/PDF_RENDER( 3424): OpenFileDocument. File: /data/user/0/za.co.mydomain.myapp/app_flutter/Cache/36d1d5da-2086-4d29-a283-4dbb1615bcbd.pdf
D/PDF_RENDER( 3424): OpenFileDocument. File: /data/user/0/za.co.mydomain.myapp/app_flutter/Cache/b6371a15-b068-497c-a410-98cf9ad9a321.pdf
E/AndroidRuntime( 3424): FATAL EXCEPTION: Thread-7
E/AndroidRuntime( 3424): Process: za.co.mydomain.myapp, PID: 3424
E/AndroidRuntime( 3424): io.scer.pdf.renderer.resources.RepositoryItemNotFoundException: 7c4172e9-dcb7-44b7-99f5-0e5f32822ff7
E/AndroidRuntime( 3424): at io.scer.pdf.renderer.resources.Repository.get(Repository.kt:12)
E/AndroidRuntime( 3424): at io.scer.pdf.renderer.NativePDFRendererPlugin$openPageHandler$1.run(NativePDFRendererPlugin.kt:129)
E/AndroidRuntime( 3424): at java.lang.Thread.run(Thread.java:764)
I/Process ( 3424): Sending signal. PID: 3424 SIG: 9

@Tahaan Tahaan added the bug Something isn't working label Oct 16, 2019
@SergeShkurko
Copy link
Member

I have an idea what could be the problem. The plugin is not yet able to simultaneously process a large number of pages. As a workaround, you can use: https://pub.dev/packages/synchronized

@RenanDelfanti
Copy link

@SergeShkurko Do you have an example how to use synchronized to prevent this issue?

@RenanDelfanti
Copy link

solved the problem by placing a one second splash screen on a stack widget

@SergeShkurko
Copy link
Member

SergeShkurko commented Feb 26, 2020

@RenanDelfanti you cant try use native_pdf_renderer 1.7.0

@RenanDelfanti
Copy link

@SergeShkurko I have same error.

E/AndroidRuntime(16771): FATAL EXCEPTION: Thread-15
E/AndroidRuntime(16771): Process: br.com.bmtcloud.jasaudeanimal, PID: 16771
E/AndroidRuntime(16771): java.lang.IllegalStateException: Current page not closed
E/AndroidRuntime(16771): at android.graphics.pdf.PdfRenderer.throwIfPageOpened(PdfRenderer.java:269)
E/AndroidRuntime(16771): at android.graphics.pdf.PdfRenderer.openPage(PdfRenderer.java:224)
E/AndroidRuntime(16771): at io.scer.pdf.renderer.document.Document.openPage(Document.kt:30)
E/AndroidRuntime(16771): at io.scer.pdf.renderer.NativePDFRendererPlugin$openPageHandler$1.run(NativePDFRendererPlugin.kt:129)
E/AndroidRuntime(16771): at java.lang.Thread.run(Thread.java:764)
D/EGL_emulation(16771): eglMakeCurrent: 0xe673f1c0: ver 3 1 (tinfo 0xd7ecf2a0)

@RenanDelfanti
Copy link

My pubspec:

native_pdf_view: ^2.1.1
native_pdf_renderer: ^1.7.0

@SergeShkurko
Copy link
Member

@Tahaan , @RenanDelfanti

native_pdf_view: ^2.2.0
native_pdf_renderer: ^1.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants