14 7월 2020
queryIntentActivities()
. Often, however, this approach provides much more access than most apps need to implement their functionality. To better protect user privacy, we updated how apps view and interact with other installed apps on Android 11.
<queries>
element in your app or library’s Android manifest allows you to describe which other apps you might need to interact with. For more information about this change, check out our Medium post on package visibility in Android 11.
<queries>
declaration. However, older versions of the Android Gradle plugin are not aware of this new element. If you add the <queries>
element or if you start relying on a library or SDK that supports targeting Android 11, you may encounter manifest merging errors. For example, when building your app you may see the following error in the Build Output Window:
Android resource linking failed
/Users/sample/AndroidStudioProjects/MyApp/app/build/intermediates/merged_manifests/debug/AndroidManifest.xml:18: error: unexpected element <queries> found in <manifest>
Manifest merger failed with multiple errors, see logs
Error: Missing 'package' key attribute on element package
<queries>
:
buildscript { repositories { google() jcenter() } dependencies { // classpath 'com.android.tools.build:gradle:4.0.0' classpath 'com.android.tools.build:gradle:4.0.1' } }