Vaibhav Shah
Vaibhav Shah

Reputation: 57

Ionic capacitor remove REQUEST_INSTALL_PACKAGES permission for android build

We are creating apps using command

ionic build --configuration=development && ionic capacitor copy android --no-build && npx cap open android

Now latest android policy tells us to remove REQUEST_INSTALL_PACKAGES this permission.

How I remove same permission.

Tried to add

<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:node="remove"/>

In file app/src/main/mainfest file

But when I hit command for build , still I can saw

capacitor-corodova-android-plugin file/mainfest/mainfest file

How can I remove that?

Upvotes: 2

Views: 5833

Answers (1)

Julio Cesar
Julio Cesar

Reputation: 310

Using <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:node="remove"/> should be enough, but it won't remove the entry from capacitor-corodova-android-plugins mainfest file as that's the original file with the permission.

What you have to check is the merged manifest.

Open the app/src/main/AndroidManifest.xml with Android Studio. There is a "text" tab and a "merged manifest" tab. Click "merged manifest" you will then see how your final AndroidManifest.xml file will look like when installed in a device and the permissions shouldn't be there.

Upvotes: 8

Related Questions