Skip to content

🚨 Android crash when uploading or previewing password-protected PDF files #600

@eNale

Description

@eNale

Description

The app crashes on Android when a user attempts to upload or preview a password-protected PDF file via the messenger.
The crash is caused by a SecurityException thrown by Android’s PdfRenderer when Intercom attempts to generate a preview for an encrypted PDF.

Affected devices / OS versions

OnePlus Nord2 – Android 13
Crash occurs immediately when selecting a password-protected PDF from the file picker

Google Pixel 6 Pro – Android 16
File uploads successfully
App crashes when tapping the file preview inside the chat

intercom_flutter: ^9.3.3
Flutter: Channel stable, 3.38.7

Error log / stack trace

E/AndroidRuntime(14793): FATAL EXCEPTION: main
E/AndroidRuntime(14793): Process: com.*********, PID: 14793
E/AndroidRuntime(14793): java.lang.SecurityException: Password required to access document
E/AndroidRuntime(14793):
	at android.graphics.pdf.PdfProcessor.create(PdfProcessor.java:146)
	at android.graphics.pdf.PdfRenderer.<init>(PdfRenderer.java:198)
	at io.intercom.android.sdk.ui.preview.ui.PreviewUriKt$loadFilesAsBitmaps$1.invokeSuspend(PreviewUri.kt:269)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:79)
	at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
	at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57)
	at android.os.Handler.handleCallback(Handler.java:1070)
	at android.os.Handler.dispatchMessage(Handler.java:125)
	at android.os.Looper.dispatchMessage(Looper.java:333)
	at android.os.Looper.loopOnce(Looper.java:263)
	at android.os.Looper.loop(Looper.java:367)
	at android.app.ActivityThread.main(ActivityThread.java:9287)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:566)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException:
	[androidx.compose.ui.platform.MotionDurationScaleImpl@79be144,
	 androidx.compose.runtime.BroadcastFrameClock@a99d22d,
	 StandaloneCoroutine{Cancelling}@d566362,
	 AndroidUiDispatcher@fdc5cf3]

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashSomething is crashingnative-sdkSpecific to native sdkplatform-androidSpecific to Android platform

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions