Created
January 4, 2023 09:07
-
-
Save tamilarasansrf/d472bbd70f0c0ca5f73d7ee4cdb158a3 to your computer and use it in GitHub Desktop.
Google rejecting android build for Request_Install_Packages permission in ionic cordova
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In this example, I'll show how to remove the REQUEST_INSTALL_PACKAGES permission. | |
Navigate to the plugins directory in your Application folder. | |
Open the plugin.xml file of each plugin and search for something like: | |
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/> | |
If you don't find anything like it, that plugin doesn't use the permission. If you do find it, remove it. | |
Navigate to: | |
yourAppFolder\platforms\android | |
Open a file, called android.json. | |
Search for code that looks like this: | |
"AndroidManifest.xml": { | |
"parents": { | |
"/*": [ | |
{ | |
"xml": "<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\" />", | |
"count": 1 | |
}, | |
{ | |
"xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />", | |
"count": 1 | |
} | |
] | |
} | |
} | |
Remove the REQUEST_INSTALL_PACKAGES part so that you're left with this: | |
"AndroidManifest.xml": { | |
"parents": { | |
"/*": [ | |
{ | |
"xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />", | |
"count": 1 | |
} | |
] | |
} | |
} | |
Note: Be careful to preserve proper JSON syntax! | |
Go to: | |
yourAppFolder\platforms\android | |
Open a file, called AndroidManifest.xml. | |
Remove something that looks like this: | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment