Problem description
The project merges the AAR of the third party, and the following errors are often reported:
Manifest merger failed with multiple errors, see logs
Solutions
Enter the following command in terminal of Android studio to print more detailed logs:
gradlew processDebugManifest -stacktrace
The implementation results are similar as follows:
C:\Users\alex\Desktop\***\app\src\main\AndroidManifest.xml:27:13-60 Error:
Attribute provider#androidx.core.content.FileProvider@authorities value=(***.provider) from [AwePhotos_0.1.11.aar] AndroidManifest.xml:27:13-60
is also present at [com.pgyersdk:sdk:3.0.10] AndroidManifest.xml:20:13-64 value=(***.fileProvider).
Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:25:9-33:20 to override.
C:\Users\alex\Desktop\***\app\src\main\AndroidManifest.xml:32:17-51 Error:
Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/file_paths) from [AwePhotos_0.1.11.aar] AndroidManifest.xml:32:17-51
is also present at [com.pgyersdk:sdk:3.0.10] AndroidManifest.xml:25:17-55 value=(@xml/provider_paths).
Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.
For the rest, follow suggestion to eliminate errors
Remarks
Need to use“ tools:replace “The place to add should be at the same level as the property to be replaced
for example, prompt replacement“ android:authorities “, you need to add the following statement:
tools:replace="android:authorities"
Add in“ android:authorities “At the following level:
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
tools:replace="android:resource"
android:resource="@xml/file_paths" />
</provider>
Similar Posts:
- Attribute application@label value=(xxx) from AndroidManifest.xml:8:16-37 is also present at [com.github.adrielcafe:AndroidAudioConverter:0.0.8] AndroidManifest.xml:11:18-50 value=(@string/app_name)
- Error:(1, 0) Plugin with id ‘android’ not found.
- Install and run Android in Androidx86 emulator – This adb server’s $ADB_VENDOR_KEYS is not set
- Problem solving SDK platform tools component is missing
- Call requires API level 4 (current min is 3) [How to Solve]
- Mac ADB prompts command not found
- Could not find com.android.tools.build:gradle:3.3.0.
- [Solved] Could not find com.android.tools.build:aapt2:3.2.1-4818971.
- SDK manager cannot open the solution (Android)
- Error:Execution failed for task’:app:processDebugManifest’