I'm working in my app to read all installed applications to get the "icon" and package name in android 11 I must use android.permission.QUERY_ALL_PACKAGES I don't want to use
<uses-permissions tag because that mean special requirements for Google Play, my app works with with the following xml tag in the Android Manifest
<permission android:name="android.permission.QUERY_ALL_PACKAGES" />
However apparently other apps are doing the same, and when they try to install my app or sideloading i receive the following message:
Failure [INSTALL_FAILED_DUPLICATE_PERMISSION: Package com.package.myApp attempting to redeclare permission android.permission.QUERY_ALL_PACKAGES already owned by com.package.another_app]
Is any way to solve this issue? Thanks a lot!
my app works with with the following xml tag in the Android Manifest
You should not getting any extra capabilities with that line. You should only be getting access to those apps based on your <queries> element, plus those that are visible to all apps regardless of package visibility rules.
However apparently other apps are doing the same, and when they try to install my app or sideloading i receive the following message:
The operating system defines that permission, as of Android 11. Apps cannot redefine that permission. Your app probably can be installed on many Android 10 and lower devices. On Android 11, since the OS is "installed" before your app, you will not be able to have that <permission> element, as you will get the error that you cite.
Is any way to solve this issue?
Remove the <permission> element. Either:
QUERY_ALL_PACKAGES,<queries> element to scope what access you need (see "Hole #1" in this blog post), orIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With