Error 908: Permission Denied

Whenever I run this code I get error 908: Permission denied. Also specify if something to be written in activitystarter.Block

Try to writing the permissions like this :
android.permission.ACCESS_WIFI_STATE
android.permission.CHANGE_WIFI_STATE

And please show me your all block.

Both are not dangerous permissions. They should be granted automatically (without user interaction).
See e.g. here: এবার শুরু করা যাক  |  Nearby Connections  |  Google for Developers

What permission is denied?
Which components / extensions are used?
What is the goal / purpose of the app?

See also here:

Anke, I have the same problem too.

android.permission.MANAGE_NOTIFICATIONS

When I ask this permission too get error that permission denied & says to allow in the
settings app. But there too I don't see permission.

I am using my own extension which manages notifications.

You can only ask for permissions that are declared in the app's manifest at compile time. If the app doesn't include the permission, then it will be automatically denied if you try to request it. If you're getting those permissions from an extension, you can only test by compiling the app as the companion won't have extension-specific permissions.

4 Likes

The extension doesn't asks permission, its requested from blocks.
Also tried building the APK but the result was same.

If using permission for the extension then should it be granted from extension directly?

From which blocks?

As @ewpatton said you can only require a permission that is declared in the Manifest.
If an extension needs a specific (dangerous) permission it should add this permission to the Manifest and ask for this permission.

This permission can only be granted by the user (not by the extension itself).

1 Like

component_method (22)

That means the permission should be there in the manifest then only we can ask right? Can we not ask directly?

Exactly. However, all you need to do is request dangerous permissions.
If your app lists a normal permission in its Manifest, that permission is automatically granted.

2 Likes

I want to develop an app which can start wifi using a button.
please guide me to develop this project.
and thank you for your support.

Just to clarify. The manifest is built into the app at compile/package time. If an extension requests a permission, then when you package an app with that extension in use, the permission will be declared in the manifest and all should work as expected.

However, if you load the extension into the Companion while debugging, the manifest, which was built when we compiled the Companion, will not be updated.

At the moment the Companion includes ACCESS_WIFI_STATE but not CHANGE_WIFI_STATE (because no MIT App Inventor component uses that permission).

You have two alternatives at this point. You can just test by packaging your app and installing it on a device. You can try building your own companion ("ant playapp") and include the permission. This may happen if you just include the extension when you build the Companion (I haven't tried this). Or you can alter the file "Compiler.java" (where the manifest is set up) to include the permission.

-Jeff

Yes, I added this permission "CHANGE_WIFI_STATE" (and also some others) to the Manifest of the Companion APK.

Manifest

But I always test my apps (especially permissions) with the compiled app (APK).

Here is a video tutorial for those interested in how to edit the Manifest:

1 Like

buenas tardes el dia de hoy quiero preguntar como puedo solucionar el problema Error 908: permisos denegados

esta es mi primera aplicacion creada con app inventor y cuando ejecuto la aplicación no me genera ningun error, pero cuando creo el apk en el movil me genera el error reportado

adjunto una captura de como configure los permisos.

si requieren mas informacion puedo compartir el projecto

Which Android version?

1 Like

Android 11. I try in Samsung galaxy s21 ultra

But in my device have all permission

see here Storage updates in Android 11  |  Android Developers

Target Android 11

If your app targets Android 11, both the WRITE_EXTERNAL_STORAGE permission and the WRITE_MEDIA_STORAGE privileged permission no longer provide any additional access.

to store files, use the ASD - application specific directory, which does not require any permission

see also the overview by @Anke here

Taifun


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

A post was split to a new topic: Where are the Ask For Permission Blocks?