Storage permission prompt issue

With the release of version 1.4C.2 we received some great improvements, but it seems a critical issue has sprung up. Tested and confirmed; apps compiled with the 1.4C.2 do not prompt for permissions.

Using this block:
storage_perm_req
…does not show a Prompt. Heading over to the Settings app, it is clear that no permissions were denied - no permissions were asked for in the first place.

However, it does trigger the Permission Denied event handler.

Strangely enough:
are_perms_granted
…seems to return True regardless. Possibly because when the app hasn’t asked for any permission, technically all permissions are granted.

NOTE: It would be very helpful if someone else could conduct further testing on which permissions are broken and to what extent.

In any case, I hope I was thorough enough. That’s all I have for now.

Happy Koding!

1 Like

And when do you use the ask for permission block?
At screen initailzed event?
What happens if you try to ask it on a button click or with a timer delay?

The permission is being requested at Screen Initialise, and also every time after dismissing a Custom Message Dialogue. The Permission Denied event handler creates the dialogue.

1. Ask for permission.
2. Permission denied.
3. GOTO 1.

Since the 3rd step happens when I click to dismiss the dialogue, rest assured that I’m not requesting permission only at the first millisecond or something.

1 Like

It does not work either.
But still permission was granted in my case.
Tested on Android 7.0

1 Like

For me it seems to be the opposite, it shows prompt

and this one returns false
bild

So for you it works correct @Boban?
Would be great if you can share a simple test aia file that other can test it.
Maybe its a android version difference?

EDIT: (WRITE_EXTERNAL_STORAGE is added to the Manifest, if you use a component or extension that requires it.)
Which component did you use, that requires this permission?

Note: To request a permission it must be declared in the Manifest.

EDIT: It seems I have lost an hour worth of work, which left the blocks messed up. The permissions are working now.

Me being an idiot

I noticed the problem on a project with a Canvas extension and Component2Image extension, both of which are capable of writing files. The app asks for both READ and WRITE on startup, and shows an error prompt if permission was denied.

Strangely enough, neither the Permission Granted, nor the Permission Denied event handlers were called, and the app silently stayed on the initial “loading” virtual screen.


I will conduct further testing today, because you have a valid point. Perhaps adding a component (maybe File or Canvas) will add the permission to the manifest.


Still, the changed behaviour seems to be suboptimal, and I must’ve missed the documentation. If someone points out the perks of the new system (assuming it isn’t a bug) or points me to the related documentation, it’d be great.

Indeed, adding a File component works. However, was this change documented anywhere?

First of all a change in the last update of Kodular:
The File component now automatically asks for WRITE permission (and READ, worked also before the update).

If a component is used that automatically asks for WRITE permission, the events ArePermissionsGranted and .IsPermissionGranted are not triggered unless this permission has been explicitly (manually) requested:

If you do not ask for this manually, ArePermissionsGranted and IsPermissionGranted will only be shown after reloading the screen if you have also set the corresponding block in Screen.Initialize block.

Let’s take that as an example

  • File component (which automatically asks for READ / WRITE, at least since the last update) and
  • the TaifunFile extension (it does not automatically ask for READ / WRITE):

File does not require a manual request from the permissions and therefore ArePermissionsGranted and .IsPermissionGranted are not triggered. In order to guarantee this, however, you must also manually ask for this permission. Otherwise they are only triggered when the screen has been reloaded and the corresponding blocks have been set in Screen.Initialize:

With the TaifunFile extension you have to ask for the permissions manually anyway (see the documentation).

Note: TheTaifunFile ext. does not automatically ask for permissions for a good reason, since it wants to ensure that it also works even if read in / write to an app-specific folder. For that no permission are needed: Manifest.permission  |  Android Developers.

(See also my very first post in the Kodular Forum: READ_ / WRITE_EXTERNAL_STORAGE permissions / app-Specific (Private) External Storage )

2 Likes