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

application crashing on opening pdf with url #113

Closed
realjoni17 opened this issue Mar 12, 2024 · 6 comments
Closed

application crashing on opening pdf with url #113

realjoni17 opened this issue Mar 12, 2024 · 6 comments
Labels
Awaiting response bug Something isn't working Fixed Scheduled to release

Comments

@realjoni17
Copy link

on opening the big file with url when we press back stack it suddenly crashes

@realjoni17 realjoni17 added the bug Something isn't working label Mar 12, 2024
Copy link

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. Need help or want to discuss this issue? Join our Discord community here to ask questions and discuss this issue live!

@afreakyelf
Copy link
Owner

Hey can you paste the logcat?

@houkhan
Copy link

houkhan commented Mar 26, 2024

Hello, I have also encountered related problems. When opening a relatively large pdf, when the PDF is still loading, that is, the loading animation has not disappeared, closing the page at this time will have this problem when rewriting and opening. When following the crash log.

************* Crash Head ****************
Time Of Crash      : 2024_03_26-10_14_45
Rom Info           : RomInfo{name=xiaomi, version=V12.5.1.0.QEECNXM}
Device Manufacturer: Xiaomi
Device Model       : MIX 3
Android Version    : 10
Android SDK        : 29
App VersionName    : 1.1
App VersionCode    : 2
************* Crash Head ****************

java.io.IOException: file not in PDF format or corrupted
	at android.graphics.pdf.PdfRenderer.nativeCreate(Native Method)
	at android.graphics.pdf.PdfRenderer.<init>(PdfRenderer.java:169)
	at com.rajat.pdfviewer.PdfRendererCore.openPdfFile(PdfRendererCore.kt:142)
	at com.rajat.pdfviewer.PdfRendererCore.<init>(PdfRendererCore.kt:76)
	at com.rajat.pdfviewer.PdfRendererView.init(PdfRendererView.kt:148)
	at com.rajat.pdfviewer.PdfRendererView.init(PdfRendererView.kt:143)
	at com.rajat.pdfviewer.PdfRendererView.initWithFile(PdfRendererView.kt:107)
	at com.rajat.pdfviewer.PdfRendererView$initWithUrl$1.onDownloadSuccess(PdfRendererView.kt:96)
	at com.rajat.pdfviewer.PdfDownloader.checkAndDownload(PdfDownloader.kt:54)
	at com.rajat.pdfviewer.PdfDownloader.access$checkAndDownload(PdfDownloader.kt:13)
	at com.rajat.pdfviewer.PdfDownloader$1.invokeSuspend(PdfDownloader.kt:31)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:367)
	at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:30)
	at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:25)
	at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:110)
	at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:126)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
	at kotlinx.coroutines.BuildersKt.launch(Unknown Source:1)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47)
	at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source:1)
	at com.rajat.pdfviewer.PdfDownloader.<init>(PdfDownloader.kt:31)
	at com.rajat.pdfviewer.PdfRendererView.initWithUrl(PdfRendererView.kt:84)
	at com.rajat.pdfviewer.PdfViewerActivity.initPdfViewer(PdfViewerActivity.kt:360)
	at com.rajat.pdfviewer.PdfViewerActivity.loadFileFromNetwork(PdfViewerActivity.kt:351)
	at com.rajat.pdfviewer.PdfViewerActivity.init(PdfViewerActivity.kt:254)
	at com.rajat.pdfviewer.PdfViewerActivity.onCreate(PdfViewerActivity.kt:243)
	at android.app.Activity.performCreate(Activity.java:7893)
	at android.app.Activity.performCreate(Activity.java:7880)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3283)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3457)
	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loop(Looper.java:224)
	at android.app.ActivityThread.main(ActivityThread.java:7562)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

@harshad008
Copy link

Any solution for this issue?

@houkhan
Copy link

houkhan commented Mar 29, 2024

@harshad008
I found this and another problem to be a bug. I listed the solution under another problem, but it is not very elegant. Reference: #114

@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
Projects
None yet
Development

No branches or pull requests

4 participants