Why does my application ask for write external storage permission?

Hello, I would like to ask you a question: I developed an app that has several functions, in one of them it opens a screen and has a canvas and two buttons forwards and backwards to show images. When I compile the application and enter this section, the application asks me "Allow the app to access the photos, multimedia content and files of your device?". If you press reject, I get another advise that says "Error 908: The permission WRITE_EXTERNAL_STORAGE: has been denied. Please enable it in the settings app." If one continues using the application, the application works perfectly, but every time I enter that section again, it asks me again if I give it permission to access photos, files, etc. I want to upload this app to the play store, and one item of the play store form ask me if my app ask for any permission, and I dont know what to say, "Yes it ask for write exernal storage permission but I dont know why". I would like the application not to ask for this permission. I don't even know why the application asks for this permission if it does not need to access the photos or the multimedia content or the files of the device, it can be done something? Thank you so much..!

Do you have any images in your app, at all ?
Do you read any images from the device on that image viewing screen?
What happens if you accept the permission request (instead of rejecting it)?
Have you considered managing the request for this permission?

Hi, thanks for answer me,

Do you have any images in your app, at all ? Yes my app have 4 or 5 png files that are showed in a canvas, through the forwards and backwards buttons.

Yes, and again my "beloved" - and apparently never ending - topic "permissions". :wink:
It's a bug. → @ewpatton

Whenever the → File component and the → Canvas component is added (even without any block being used), Canvas requests WRITE permission.

Designer

4 Likes

Thanks for answering Anke, and what do you think I should do? Write in the Privacy Policy that my app requests that permission but that it is actually a bug and the application will work perfectly even if I accept or reject that permission? And that will not read anything from the device? Thanks for your opinion..!

Remove the permission from the Manifest if it is definitely not needed, i.e. the app otherwise works properly.

2 Likes

Remove the permission from the Manifest. Thank you, thank you, thank you so much.. !! At the beginning when I opened the link you put on how to modify the manifest you should have seen my face when I saw all those codes and that program ..! I was very scared because I am a very beginner, and I have barely learned to use the appinventor, but I took a deep breath and little by little I was encouraged to do it (after I read what you wrote that it was easy and that in less than 1 minute I could do it do). I downloaded the APK Editor Studio program, decompiled the apk, deleted the read and write external storage, saved the changes again, compiled and reinstalled the application and now it no longer asks me for any permission ..! Thank you very much Anke .. !!! God bless you..! :slight_smile:

2 Likes

That's probably because, that the canvas component automatically asks the WRITE_EXTERNAL_STORAGE permission, if there exists any component that declares this permission in the app's manifest, for instance the File component, the Image Picker component,etc.. :wink: I think, because of this line :thinking:

2 Likes

Yes.

Note: The ImagePicker doesn't need and declare WRITE permission, only READ.
But the

  • SoundRecorder
  • Web component
  • ...

declare WRITE permission in the Manifest.

ImagePicker permission

However, Kodular does not have this bug.

2 Likes

Yes, but seems that Ai2 image picker needs to declare the write permission in the manifest:

As it copies the saved image to the external storage , which requires the write permission:

2 Likes

Yes, more precisely, the ImagePicker only declares the WRITE permission.

Note: But I think (hope) this will be changed when AI2 targets API 30 (Android 11).

1 Like

I am facing the same problem; it would be great if this permission is not requested "by default"

Thanks!

for the image picker alternatively try this
How to pick an image using the activity starter

Taifun


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

1 Like

I have the same problem with the Canvas component. The apk needs by defalut the WRITE EXTERNAL permission and this is a problem for the end user to give habilitiby for access the phto mobile. There is any new about this issue on the AI2?

unfortunately App Inventor was designed like this to request that permission...
if you do not read or store anything on the device, you can remove the permission manually like this as already mentioned in post 7 of this thread

Taifun


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