Why my app has access to location permission.?

I just saw my app in play store below is screen shot.
Why its has access to location. I have 5 other app all have same thing. But I did’t code to access location.

Well you see, App Inventor works in mysterious ways, basically when you add a component into your application (you don’t even have to use any blocks) it will still add the permissions to your application. Why? I’m not sure. However there’s no need to worry if it doesn’t get requested.

1 Like

I worried about if google remove my app. ?

Google shouldn’t remove your application from the Play Store.

Why did you add the Location_Sensor to your project when you don’t need it?

As soon as a component is added that needs a dangerous permission, this permission must be declared in the Manifest. Hence this is by no means mysterious.

When this permission is actually requested depends on the blocks used or, in the case of the Location_Sensor, on whether it is enabled in the Designer.

I don’t think you understood what I meant. Let’s say you don’t use the component, or you use a block that doesn’t require the “dangerous” permission… It will still add the permission to the manifest, even if it doesn’t use it. It gives a bad impression to the user when there’s just a permission sitting there that’s useless.

Don’t make it obvious :face_with_raised_eyebrow:

Yes of course. It is not a question of whether the component is used or not, but rather the question of whether this component has been dragged into the project. If the latter is the case, the permission must be declared in the Manifest.

For example, if the permission is not declared in the Manifest, the component will never work on devices < API 23 (Android 6), because this permission is requested and granted at install-time (and NOT at run-time). Therefore it must be declared in the Manifest (at install-time).


I meant, check if the block that requires the extension has been used in the project and add the permission to manifest at compile-time if so… This approach would make it so that useless permissions wouldn’t be added to the manifest, but the component would still function as normal even if the application doesn’t declare a permission that is used for another block that wasn’t used in the project.

If you are using Location sensor in your app as @bodymindpower told, then, it’s it would ask for location permission.
And if it’s not the case then you must be having Ads displayed in your app. The ads component also require the location permission

But why should someone add a component to their project that they don’t even need / use?

1 Like

Again, you’re failing to understand the concept of my idea if it hasn’t been added yet.

Sometimes only certain blocks will require a specific permission, not the whole component. What if you could use the @UsesPermission annotation on blocks, so that when the block is used in the project, App Inventor will determine that and add the permission to the manifest.

I understand your idea quite well, but it doesn’t make much sense to me or is more of a theoretical consideration.

Which blocks of a component could these be that someone would like to use without wanting to use the core function of a component (let’s stick with the example of the Location_Sensor)?

Right, location sensor would need the permissions, but many other components and extensions may declare permissions that aren’t needed, such as the DeviceUtils component. It requests permissions when going to get the IMEI of the device, however it still adds permissions to the manifest even if it’s not used.


Yes, but it doesn’t ask for permission. But you’re right, it would actually be easier if the permissions could be queried beforehand before they are automatically declared in the Manifest. However, I have little hope that AI2 or Kodular will ever do this.

In such cases, I do it so that I remove this permission from the Manifest before I publish the app. This applies e.g. B. also for the Player component that declares READ permsission. Since I basically play from the assets or the ASD, I do not need this permission for devices with API> 19.

1 Like

Sure, but removing permissions from the manifest can become a hassle after doing it so many times.

I have certainly done it more than 1000 times, it takes less than 20 sec.

You use GUI I’m assuming?

@hammerhai However, the question still remains open whether it would be at least theoretically possible to be able to query the need for a permission at compile time (on the build server).

1 Like

In screen call for ask for permission

most probably because you are using ads

1 Like