Capacitor-cordova-android-plugins uses the permission REQUEST_INSTALL_PACKAGES. Google Playstore will soon disable apps with this permission from updates unless a new sensitive permission declaration is to be filled in. Is it possible to somehow remove this permission from the project?
Hello, have you been able to solve it? The same happened to me.
Try adding this to your AndroidManifest.xml, I’ve done it with other permissions and worked.
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:node="remove" />
@monka I am curious if the above helped, as this may have come from a cordova plugin you have installed. It would be helpful if you could share what cordova plugins you have in your project currently.
-
I remove this permission by this guide: How to completely remove an Android permission from Cordova app. · GitHub
-
In my case, REQUEST_INSTALL_PACKAGES is a permission on plugin
cordova-plugin-file-opener2
. Remove permission manually is just temporary fixed. If you reset likecordova platform add android
orcordova plugin add cordova-plugin-file-opener2
, the REQUEST_INSTALL_PACKAGES comebacks by generation.
did any one manage to overcome this issue. As the previous person mentioned, removing the permission manually doesn’t help as it is re-added automatically when we build in Ionic
Adding this to Android Manifest worked for me:
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:n
But you need to add this first at the beginning:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="#{appId}#" xmlns:tools="http://schemas.android.com/tools">
Thanks. Do we replace appID with our own id
You can actually leave that out, the most important part is this:
xmlns:tools="http://schemas.android.com/tools"
so adding the tools It enables you to use the “tools:node=remove”" part
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:node="remove"/>
We still see the permission after we build it from Ionic
Added the xmlns:tools=“http://schemas.android.com/tools” part at the top and
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:node="remove" />
i am using ionic-5.
in AndroidManifest.xml we modified with
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:node="remove" />.
then if we build again its adding new uses-permission in AndroidManifest.xml and showing error like
> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
did you add this to the top, as suggested by Monka
yes ,not work for me. its adding new permission.
same for us. our local apk file doesn’t have the permissions but when we build/deploy in Ionic, they get added back in
In /node_module/cordova-plugin-file-openner2/plugin.xml
I was comment out this line
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
then after rebuild no REQUEST_INSTALL_PACKAGES appear on any AndroidManifest.xml
Maybe you need to add the xmlns tools schemas in your AndroidManifest try:
<manifest xmlns:tools="http://schemas.android.com/tools">