Error 908: The permission read_external_storage has been denied

I recently had a problem with my app (which opens pdf documents with activityStarter and I can also listen to mp3) when updating my Pixel 3a with Android 11. I decided to start by checking basic things because I don't know where the error is.
I see that I now have this error that I didn't have before. Why could it be?

my guess is, you can't use the activity starter to pick a file from shared storage anymore?
try the SAF extension

Taifun

2 Likes

Thanks for this extension!
I have tried to open a pdf file from a particular directory but I don't know how to do it now. Please could you tell me how to open a pdf with an example, so I have an idea of how this extension works without using ActivityStarter.

Thanks

1 Like

You can pick (media) files from any (visible*) folder.

(* means not from the ASD on Android 11, because the dir is no longer visible on Android 11).

1 Like

Anke but why it does not grant permissions to open files (from visible directories)?

Thanks

Why should it?

So far it has worked for me. But recently my app stopped working (it does work on the tablet with android 7) when opening pdf files and listening to music using activitystarter.

Stopped working only on Android 11?
Post the aia or a test aia.

It's a strange thing happening with my Pixel 3a (I apologize for this question because even I find it a mess):
As my app was failing (which is a bit complex) I decided to start trying basic things with a simple app to see where the problem could come from. The first thing I found is that when I asked for read permissions I was getting error 908:... that's why I wrote this post.
Trying several times in the end it stopped giving me this error without knowing why, since it is something very simple (ask for read permission). I don't know why this happens!!

Now that I have read permissions (in the simple app to do the test), I continue checking things and what I see that with AtivityStarter I can open pdfs and listen to music!. But I see that what fails is to make a list with the PDFs in the direct drive using the Taifunfile extension.

Here are the blocks I used. When I pick the ListPicker it finds all the files except the pdfs (and I have checked that in the folder there are pdf files, plus photos and music), however the photos and audio files do.

I have checked the version I have in the app and it is the 12th but I have seen that in the extension web is the 13th. I have updated the extension but still with the same problem. Here I put the test app so you can check that it does not list the pdf files:
Test.aia (34.0 KB)

To list / read non-media files from a Shared folder they must be created by the app itself.

See also here:

To list / read non-media files (created by other apps) you need SAF.

1 Like

Thank you Anke!
Using .listdirectory scope what I see is that I get the list of files but without the path. I don't know exactly what its usefulness is in my problem.

Well now let's see if I can figure out how SAF works to list pdf and mp3 files, and then open them.