265
Views
15
Comments
Solved
How can I remove permissions READ_MEDIA_IMAGES  and READ_MEDIA_VIDEO from our app?
Question

Google has a new rule, saying that if you have 

android.permission.READ_MEDIA_IMAGES or 

android.permission.READ_MEDIA_VIDEO 

in your manifest you need to specify a good reason for this or remove them from the manifest. The only good reason is apparently if your app is a (and I quote) "gallery app, or if its core functionality is editing, managing and maintaining photos."

Our app is definitely not that, so we should remove them, but they seem to be hardcoded in every app we build. So how do we fix this? 

This is Google's documentation on this, the deadline is October 31st of this year, and January 22nd of 2025 is we ask for an extension. 

2020-04-21 08-15-30
William Antunes
 
MVP
Solution

Hello @Abhinav Shilwant  and Wendy,


We actually have a property documented specifically for this. See in the documentation:

https://success.outsystems.com/documentation/11/deploying_apps/mobile_apps_packaging_and_delivery/customize_your_mobile_app/extensibility_configurations_json_schema/




It should be added into your extensibility configurations as per the example below:

{

   "preferences":{

      "global":[

         {

            "name":"AddUploadWidgetPermissions",

            "value":"false"

         }

      ]

   }

}


I hope this helps to sort out your issue. If anyone is having errors about removing the READ_MEDIA_IMAGES and READ_MEDIA_VIDEO as the standard permissioning in your manifest, the property above should be enough to fix it as per Google's new policies.




Thank you!




2024-05-28 00-11-35
Luis Andrés Jara Vásquez

Hello, 

I did the tweak and recompiled, 


but when I check the file inside the native "AndroidManifest.xml" I still find:



Do you know if something is missing? or is it okay like this?

Regards

UserImage.jpg
Shikha Basra

I have the same issue to remove the permissions  READ_MEDIA_IMAGES  and READ_MEDIA_VIDEO from our app. However we need minimal access to gallery for picking the images or videos. So I need to implement the Android photo picker as per suggested by Google for our app. Could you please suggest any plugin in outsystems?

UserImage.jpg
Shikha Basra

I tried camera plugin and it worked. However, I need a single plugin that will work for both media and other file formats like File upload widget.

UserImage.jpg
Shikha Basra

{

   "preferences":{

      "global":[

         {

            "name":"AddUploadWidgetPermissions",

            "value":"false"

         }

      ]

   }

}
This configuration is disabling the file upload control in android.
Could you please tell how can we manage to upload media and files using file upload control

UserImage.jpg
Cagri Keskin

Hello

I tried the same but it doesn't work.

google is still giving the same error.


my extensibility setting is like:


{

  "preferences": {

    "global": [

      {

        "name": "AddUploadWidgetPermissions",

        "value": "false"

      }

    ],

    "android": [

      {

        "name": "android-minSdkVersion",

        "value": "24"

      }

    ],

    "ios": [

      {

        "name": "UseSwiftLanguageVersion",

        "value": "5"

      }

    ]

  }

}

2023-01-19 12-23-07
Abhinav Shilwant

Hi @Wendy Tromp 

To remove the READ_MEDIA_IMAGES and READ_MEDIA_VIDEO permissions from your OutSystems mobile app, follow these steps:

1) Check Your Manifest File:

  • Go to your Mobile App Settings in OutSystems and inspect the Android Manifest. 
  • If these permissions are hardcoded, check whether they are explicitly declared in your custom plugins or any system components that your app might be using.

2) Override Manifest Permissions in MABS:

  • OutSystems Mobile Apps (MABS) automatically generates a manifest file. To override specific permissions, you can use the Extensibility Configurations.
  • Add the following to the Extensibility Configurations to explicitly remove the permissions:

<config-file parent="/manifest" target="AndroidManifest.xml"> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" tools:node="remove" /> <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" tools:node="remove" /> </config-file>

This will ensure that these permissions are removed when the APK is generated.

3) Check Plugins:

  • Some plugins may include permissions for media access. Review the plugins in your application for any that require media-related permissions and see if they provide configuration options to exclude them.

4) Verify and Rebuild:

  • Once you’ve made the necessary changes, rebuild your mobile app using MABS.
  • Test the build to ensure that the permissions have been removed and the app functions correctly without them.

By following these steps, you should be able to remove the unwanted permissions before the Google deadline. Let me know if you need more detailed guidance on any of the steps.

Hope this helps!

Regards,

Abhinav

UserImage.jpg
Cagri Keskin

Hello Abhinav

1st step I don't know where I can see the manifest file but when I upload my bunle app to google play, it is giving this error.

"undecleared permissions"


so I assume I have them in my manifest.


2nd step;

extensibility configuration is in json format, this format is not allowed.

can you show how can I insert this code to my extensibility configuration



UserImage.jpg
Wendy Tromp

Thanks for the quick reply! 

My Extensibility Configuration is JSON though, I doubt XML will be accepted as an addition. 

Can you point me to the documentation that explains all this or did you figure it out yourself?


2019-11-08 12-58-29
Teun de Jong

Hi Abhinav,

I'm facing the same issue and I have tried to convert your code to JSON and add it tho the Extenisbility Configurations of my app.

It did not change the permissions :(

Could you explain how to implent your solution?


I have tried the following JSON:

{
    "config-file": {
        "$": {
            "parent": "/manifest",
            "target": "AndroidManifest.xml"
        },
        "uses-permission": [
            {
                "$": {
                    "android:name": "android.permission.CAMERA",
                    "tools:node": "remove"
                }
            },
            {
                "$": {
                    "android:name": "android.permission.READ_MEDIA_IMAGES",
                    "tools:node": "remove"
                }
            },
            {
                "$": {
                    "android:name": "android.permission.READ_MEDIA_AUDIO",
                    "tools:node": "remove"
                }
            },
            {
                "$": {
                    "android:name": "android.permission.READ_MEDIA_VIDEO",
                    "tools:node": "remove"
                }
            }
        ]
    }
}

2020-04-21 08-15-30
William Antunes
 
MVP
Solution

Hello @Abhinav Shilwant  and Wendy,


We actually have a property documented specifically for this. See in the documentation:

https://success.outsystems.com/documentation/11/deploying_apps/mobile_apps_packaging_and_delivery/customize_your_mobile_app/extensibility_configurations_json_schema/




It should be added into your extensibility configurations as per the example below:

{

   "preferences":{

      "global":[

         {

            "name":"AddUploadWidgetPermissions",

            "value":"false"

         }

      ]

   }

}


I hope this helps to sort out your issue. If anyone is having errors about removing the READ_MEDIA_IMAGES and READ_MEDIA_VIDEO as the standard permissioning in your manifest, the property above should be enough to fix it as per Google's new policies.




Thank you!




2024-05-28 00-11-35
Luis Andrés Jara Vásquez

Hello, 

I did the tweak and recompiled, 


but when I check the file inside the native "AndroidManifest.xml" I still find:



Do you know if something is missing? or is it okay like this?

Regards

UserImage.jpg
Shikha Basra

I have the same issue to remove the permissions  READ_MEDIA_IMAGES  and READ_MEDIA_VIDEO from our app. However we need minimal access to gallery for picking the images or videos. So I need to implement the Android photo picker as per suggested by Google for our app. Could you please suggest any plugin in outsystems?

UserImage.jpg
Shikha Basra

I tried camera plugin and it worked. However, I need a single plugin that will work for both media and other file formats like File upload widget.

UserImage.jpg
Shikha Basra

{

   "preferences":{

      "global":[

         {

            "name":"AddUploadWidgetPermissions",

            "value":"false"

         }

      ]

   }

}
This configuration is disabling the file upload control in android.
Could you please tell how can we manage to upload media and files using file upload control

UserImage.jpg
Cagri Keskin

Hello

I tried the same but it doesn't work.

google is still giving the same error.


my extensibility setting is like:


{

  "preferences": {

    "global": [

      {

        "name": "AddUploadWidgetPermissions",

        "value": "false"

      }

    ],

    "android": [

      {

        "name": "android-minSdkVersion",

        "value": "24"

      }

    ],

    "ios": [

      {

        "name": "UseSwiftLanguageVersion",

        "value": "5"

      }

    ]

  }

}

UserImage.jpg
Wendy Tromp

For the Camera plugin the 7.7.0 version no longer has the permissions. So I think you don't need to do anything, just update the plugin.

In your screenshot I see something about screen orientation, is that the plugin you are talking about? Which plugin is that?

2025-01-31 07-14-38
Christo Van Niekerk

I can confirm Camera Plugin 7.7.1 has the permissions removed. I tore my hair out trying to figure out why the builds were different across environments. Turns out they just had an older version of the Camera Plugin.

UserImage.jpg
Jorge Ribeiro

Hi everyone,

I’ve tried implementing all the suggested solutions to remove the READ_MEDIA_IMAGES and READ_MEDIA_VIDEO permissions from our app. However, when checking the manifest, these permissions are still present.

Another point I want to clarify is that the app is not a gallery app, but it requires permissions to use plugins like the camera plugin and barcode plugin to capture evidence.

Do I really need to implement these permission removals, or should I just justify the use of the plugins in the Google Play Console? I’ve also been informed that removing these permissions might block access to the plugins—can anyone confirm if this is true?

Any guidance or advice would be greatly appreciated!

Thank you!

UserImage.jpg
Wendy Tromp

We got approved with this text in the declaration:

"Users are able to upload images of documents to the app instead of capturing an image live. The uploaded/captured images are downsized to reduce their size. "

But upgrading the plugin to 7.7.0 would probably be a better idea

UserImage.jpg
Cagri Keskin

facing the same issue

tried to add the suggested solution, but seems not worked


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.