I have imported some AOSP code into my application, and during execution of processDebugAndroidTestManifest
task, it throws java.lang.RuntimeException
:
Error:Execution failed for task ':contacts_common:processDebugAndroidTestManifest'. java.lang.RuntimeException: Manifest merger failed : Attribute path-permission@pathPrefix value=(/search_suggest_query) from [gcs:contacts_provider:unspecified] AndroidManifest.xml:31:17-59 is also present at [gcs:contacts_provider:unspecified] AndroidManifest.xml:34:17-62 value=(/search_suggest_shortcut). Suggestion: add 'tools:replace="android:pathPrefix"' to element at manifestMerger6750235787399637901.xml to override.
It is strange, because I'm sure that some time ago a manifest merger did not raise objections.
I can't add 'tools:replace="android:pathPrefix"'
element, because I need to use both, permissions, just as in AOSP.
How can I use two different pathPrefixes
in provider?
Here is my provider
:
<provider
android:name="some_name"
android:authorities="some_authorities"
android:exported="false"
android:label="@string/provider_label"
android:multiprocess="false" >
<path-permission
android:pathPrefix="/search_suggest_query"
android:readPermission="android.permission.GLOBAL_SEARCH" />
<path-permission
android:pathPrefix="/search_suggest_shortcut"
android:readPermission="android.permission.GLOBAL_SEARCH" />
<path-permission
android:pathPattern="/contacts/.*/photo"
android:readPermission="android.permission.GLOBAL_SEARCH" />
<grant-uri-permission android:pathPattern=".*" />
</provider>
Using ./gradlew assembleDebug
works fine. Exception is being thrown only in Android Studio.
I'm using Android Studio 2.1.1, build gradle tools 2.0.0 and 2.1.0.