Sorry if this has been reported already but I couldn't find anything. PDF viewer app keeps crashing when I try to open a file larger than 2 pages. I'm on the latest version "19" and have posted the crash log.

type: crash
osVersion: google/shiba/shiba:14/AP1A.240505.005/2024050700:user/release-keys
package: app.grapheneos.pdfviewer:19
process: app.grapheneos.pdfviewer
processUptime: 2750 + 190 ms
installer: app.grapheneos.apps

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1021475605, result=-1, data=Intent { dat=content://org.nextcloud.documents/... flg=0x43 }} to activity {app.grapheneos.pdfviewer/app.grapheneos.pdfviewer.PdfViewer}: android.os.NetworkOnMainThreadException
	at android.app.ActivityThread.deliverResults(ActivityThread.java:5767)
	at android.app.ActivityThread.handleSendResult(ActivityThread.java:5806)
	at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:69)
	at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:60)
	at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:195)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:157)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:90)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2551)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8532)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ExecInit.main(ExecInit.java:50)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
Caused by: android.os.NetworkOnMainThreadException
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3201)
	at android.os.Parcel.createException(Parcel.java:3175)
	at android.os.Parcel.readException(Parcel.java:3151)
	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:202)
	at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:165)
	at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:814)
	at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:2068)
	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1883)
	at android.content.ContentResolver.openInputStream(ContentResolver.java:1553)
	at app.grapheneos.pdfviewer.PdfViewer.z(Unknown Source:14)
	at i0.d.a(Unknown Source:103)
	at androidx.activity.result.g.a(Unknown Source:44)
	at androidx.activity.l.onActivityResult(Unknown Source:2)
	at e.g.onActivityResult(Unknown Source:5)
	at android.app.Activity.dispatchActivityResult(Activity.java:9170)
	at android.app.ActivityThread.deliverResults(ActivityThread.java:5760)
	... 16 more

    Daveed PDF viewer app keeps crashing when I try to open a file larger than 2 pages.

    Does it happen with a specific file or any file? If it's a specific file you could probably link to it here so we can test.

    Where are you trying to open the file(s) from? Are you using Nextcloud?

      fid02 it happens with every file I try to open. All my files were downloaded from Next cloud but I haven't had this issue before. I'll see which file I can upload to see if its maybe just me.

      It seems when I open a file from the files and choose PDF viewer as the app to view it, it works fine. But from within the PDF app itself is where I have the issue. Strange but not that big of an issue.

      This could be a Nextcloud app issue if that's where you're opening them from. We can look into it.

        GrapheneOS I guess technically I'm opening from the Nextcloud app since I'm opening from the pixel 8>media>com.nexcloud.client folder? I'm not sure how that works exactly.

        • de0u replied to this.

          Daveed I guess technically I'm opening from the Nextcloud app since I'm opening from the pixel 8>media>com.nexcloud.client folder?

          I believe so.

          If you copy one of these files from that folder into local storage (e.g., the "Downloads" folder), and then open that copy, does the crash still happen? It would be good to conclusively rule out file contents as being part of the problem.

            de0u No, it doesn't crash if I do it that way. In fact, I just tried to reproduce it but it seems to be working now.