OS.shell_open() does not open files (Android)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By apaudel96

I have a pdf file in my res:// folder. Let’s call it file.pdf.

The main scene has the following structure:
Control
–Button

with the following code:

extends Control

func _on_Button_pressed():
    print("Button Pressed")

    var error = OS.shell_open("file.pdf")

    if error:
	    print(error)
    else:
	    print("file.pdf opened")

This works as expected and opens the pdf file on PC (Ubuntu) but doesn’t open the file on android.

The debugger outputs:
Button Pressed
19


:bust_in_silhouette: Reply From: sarthakroy

I was also facing these issues earlier but then I found that the path with " res:// " isn’t accessible in Android .
Instead save it in " users:// " as there you can access it even in Android.