Error 908: The permission Write_External_Storage has been denied while using web component to download a file

Hi and thanks for all info.

I get a similar problem while trying to import images from Google Drive when testing my app on the phone. The AI Companion works fine.
Error 908: The permission Write_External_Storage has been denied. I am guessing the “Web.SaveResponse = True” block set things in motion…?

.

Is it possible to fix this by setting permissions on Screen1? I would appreciate instructions for how to do that. Thanks.

/erik

@Erik_Privat

Try:

(this also gives read permissions)

1 Like

Hi Tim,
Thanks. Did just that and it gave permission once and the app uploaded images nicely. But the second time around the permission didn’t show up and the images didn’t load!? Re-started the app, but it didn’t show permission or images… I put the permission request not on Screen1, but on the screen where the images should be. Is there a difference between Screen1 and other screens in the case of permissions?
/Erik

Once a permission has been granted, it remains forever, unless you go to the app settings and disable this permission again or you delete the data of the app.
So the problem described cannot be due to the (already granted) permission.

Hi Anke,

Thanks for the information. The strange thing is that the AI Companion works fine, all images loading nicely from Drive. Looks like the app on the mobile is generating the problem. Where start looking for the problem…? Is there a difference if the permission request is on Screen1 instead of the image screen?
/Erik

no, it doesn’t matter

It would really help if you provided an updated screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

it seems to be, you are using 3 web components to download 3 images?
you might want to use only one web component and download the images one by one, see also https://puravidaapps.com/filebyfile.php

Taifun

Hi Taifun,
Thanks for the information. I will check out the link asap. Here are the key blocks.


In this screen I moved the WebImage blocks from Permission Granted to Initialize. This time I got 3 error messages, but also 3 Permissions that I OKed. Then the images loaded nicely into the app. On exit I had to click the exit 3 times!? Is Close Application connected to this problem…? When re-starting the app there is no problem with loading the iages and only 1 click on exit is OK. Thanks for your help. Very much appreciated!
/Erik

Hi again,
…some more info. Did a total delete and re-installation of the app and got the same 3 error messages (908), but now only 1 permission to OK. Did that, and no images loaded at that point. Moved to another screen and back again. Then all images loaded nicely again. And only one click for exit… strange…
/Erik

You have to use the .PermissionGranted event:

grafik

I have done that. I am not sure I understand what you mean. I have tested to put all WebImage blocks inside PermissionGranted, it didn’t work at all.

Taifun

1 Like

Hi again, I tried that and the error message doesn’t appear and one permission message appears. After OK the first two pictures are loaded correctly and the third is replaced by a copy of the first!!!. After jumping to another screen and then returning, no images are loaded. (probably because When PermissionGranted event is not called for?) . After re-start I get the same result. Exit takes three clicks on exit button! …any ideas for the next step?
/Erik

Download the files one by one as already suggested earlier…

Also switch screens correctly…
See tip1 here

Taifun

1 Like

Here is why
closeScreenWrong

instead, use the closescreen block instead of open another… close screen returns you to Screen1 like magic!

With App Inventor 2, NEVER re-open Screen1

Thanks You, I’ll implement that and let you know the result.
/Erik

Thank You Steve, I’ll modify that! Strange that in other projects I have done, jumping back to Screen1 hasn’t resulted in these kind of problems… maybe the combination of two bad ideas(jump to Screen1 and loading 3 images at once) resulted in this… Thanks for the good advice!
/Erik

Hi Tim, Taifun, Anke, Steve. Big thank you to all for great help!!! Several problems mixed together made it difficult to analyze the issues. Now problems fixed! Permission: I had to put the Permission request on Screen1 to fix the issue. Loading of images: Solved by loading images one by one. Exit problem: Solved by having Screen1 as master and close screens when leaving (took a major effort to do that change :slight_smile: really teaches you check out the basics…!). Big Thank You!!!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.