Hello,
Firstly, It is not recommended to query all of installed application, Google is restricting which apps can see the other installed apps on your device. you can limit to query it.
Please add following QUERY_ALL_PACKAGES permission in your AndroidManifest.xml
. It is a normal permission and it is granted as soon as the app is installed.
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
Please note: Google outlines permitted uses of the QUERY_ALL_PACKAGES permission as follows:
Permitted use involves apps that must discover any and all installed apps on the device, for awareness or interoperability purposes may have eligibility for the permission. Permitted use >includes; device search, antivirus apps, file managers, and browsers.
If your app meets the permitted application for the acceptable use of the QUERY_ALL_PACKAGES permission, you will be required to declare this and any other high-risk permissions using the Permissions Declaration Form in Play Console.
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.