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

[BUG] java.lang.IllegalStateException: Current page not closed #109

Closed
VortanaSay01 opened this issue Feb 5, 2024 · 7 comments
Closed
Labels
Awaiting response bug Something isn't working Fixed Scheduled to release Non reproducible

Comments

@VortanaSay01
Copy link

📝 Describe the Bug

App crash when repeat these these steps: open pdf via pdfViewerActivity then back from activity.

📖 Library Version

  • PDF Viewer Version: [e.g., 2.0.5]

🚶 Steps to Reproduce

Please follow these steps to reproduce the issue:

  1. start pdfViewerActivity with launchPdfFromUrl
  2. click on link to open pdf
  3. click back
  4. click on link to open pdf again
  5. click back
  6. repeat these two steps
  7. App crash

🤔 Expected Behavior

App should open pdf and no crash

🖼️ Screenshots/Videos

If applicable, add screenshots or videos to help explain your problem.

📱 Smartphone Info:

  • Device: Samsung
  • OS: Android 12
  • Library Version: 2.0.5

💻 Code Snippets

startActivity( PdfViewerActivity.launchPdfFromUrl( context = this, pdfUrl = uri.toString(), pdfTitle = "", saveTo = saveTo.ASK_EVERYTIME, enableDownload = true ) )

📜 Log Output/Stack Trace

Caused by: java.lang.IllegalStateException: Current page not closed at android.graphics.pdf.PdfRenderer.throwIfPageOpened(PdfRenderer.java:279) at android.graphics.pdf.PdfRenderer.close(PdfRenderer.java:191) at com.rajat.pdfviewer.PdfRendererCore.closePdfRender(PdfRendererCore.kt:175) at com.rajat.pdfviewer.PdfRendererView.closePdfRender(PdfRendererView.kt:242) at com.rajat.pdfviewer.PdfViewerActivity.onDestroy(PdfViewerActivity.kt:507) at android.app.Activity.performDestroy(Activity.java:8571) at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1364) at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5937) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5995)  at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:47)  at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)  at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2438)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loopOnce(Looper.java:226)  at android.os.Looper.loop(Looper.java:313)  at android.app.ActivityThread.main(ActivityThread.java:8663)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135) 

💬 Additional Context

Add any other context about the problem here. Mention if the issue is consistent, specific scenarios where the bug occurs, etc.


@VortanaSay01 VortanaSay01 added the bug Something isn't working label Feb 5, 2024
Copy link

github-actions bot commented Feb 5, 2024

Thank you for creating your first issue. We appreciate your help in making this project better. We will look into it, and get back to you soon.

@sumit-joshi28
Copy link

I had reported one crash similar to your case, and this issue still exists but it is closed without a fix or solution.

#100

@ArisonRaik
Copy link

I noticed this bug when you close the PDF while displaying a page with a huge image, like the cover of a book

@afreakyelf
Copy link
Owner

Hey, Can you share what device you are using? It could be a performance-related issue, as I could not reproduce it.

Thanks

@ArisonRaik
Copy link

I tested on an Asus M2 and on a Samsung A1, both had this same issue

@VortanaSay01
Copy link
Author

I saw the issue in Samsung Galaxy. Android 12. I also noticed the issue when open pdf before it load or quickly press back to previous screen.

@afreakyelf afreakyelf added the Fixed Scheduled to release label Apr 1, 2024
@afreakyelf
Copy link
Owner

Hi, The Above issue has been fixed in new release. https://github.com/afreakyelf/Pdf-Viewer/releases/tag/v2.1.0

Please migrate to Maven central. More here: https://github.com/afreakyelf/Pdf-Viewer/releases/tag/v2.1.0

Thank you for using the library. Please reopen/raise a new issue if you still face this error.

Join our discord for more updates!

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

No branches or pull requests

4 participants