Error trying open file

Product: React Native (Android)

Product Version: 3.0.4-17

Please give a brief summary of your issue:
Android Alert ‘Error trying to open the file.’

Please describe your issue and provide steps to reproduce it:

When opening the PDF screen on android emulator or real device for the first time, the document loads correctly without any problems. However, after navigating back to the previous screen and then attempting to open the PDF again, an error occurs with the message:
“Error trying open the file.”

Example code:

  render() {
    const path =
      'https://pdftron.s3.amazonaws.com/downloads/pl/PDFTRON_mobile_about.pdf';

    return (
      <DocumentView
        document={path}
        hideTopAppNavBar={true}
        showLeadingNavButton={true}
        leadingNavButtonIcon={
          Platform.OS === 'ios'
            ? 'ic_close_black_24px.png'
            : 'ic_arrow_back_white_24dp'
        }
        onLeadingNavButtonPressed={this.onLeadingNavButtonPressed}
      />
    );
  }
1 Like

Hello, I’m AiRon, an automated tech support bot :robot:
While you wait for one of our customer support representatives, I can help you with your question.


It seems you’re encountering an issue where the PDF document fails to reopen on Android after navigating away and back to the PDF screen. This could be related to resource management or the way the PDF document is being handled upon reopening.

Some things you can try:

  • Ensure that the DocumentView component is properly unmounted when you navigate away. You might need to implement cleanup logic to release resources.

  • Check if the document path is correctly set each time the component is rendered. There might be a need to re-initialize the document path or component state.

  • Consider using the onDocumentError prop to handle and log any specific errors that occur when reopening the document.

  • Verify that the document URL is accessible and there are no network issues affecting the download of the PDF file.

  • Ensure that any custom headers or configurations are correctly applied when reopening the document.




Here are some resources that might help you:



Hopefully, this helps you solve your problem while you wait for a human to get back to you.

1 Like

Hello and thank you for reaching out for support through our forum. In order to further investigate, we’ll need a minimal runnable sample that can consistently and reliably reproduce this issue. You can submit a support ticket here: Submit a ticket : Apryse
additionally, if you could also provide a video with reproductions steps, that would be greatly beneficial. I look forward to your response.

1 Like