Manifest merger fails on the android.adservices.AD_SERVICES_CONFIG property
Manifest merger failedShort answer
Two manifests declare the same property with different @xml resources and the merger will not choose. Find the library that declares it. If it is an old Google Mobile Ads SDK, upgrade to 24.0.0 or later, where the tag was removed. Otherwise add tools:replace for android:resource to your own property.
Fix it fast
1Find out which cause you have
Read the full build error: it names the library manifest that declares the same property. For the whole merge decision, open the manifest merger report of the failing variant.
./gradlew :app:processDebugMainManifest grep -n "AD_SERVICES_CONFIG" app/build/outputs/logs/manifest-merger-debug-report.txt2Match what you see, then jump to its fix
- 1
The error names com.google.android.gms play-services-ads (or a library that bundles it) as the second source, and your app declares the property as wellAn older Google Mobile Ads SDK still declares the propertyFix - 2
The merger error shows two different @xml values for the same property, one from your AndroidManifest.xml and one from a libraryYour manifest and a library set different resources for the same propertyFix
- 1
What does the error look like?
Manifest merger failedAttribute property#android.adservices.AD_SERVICES_CONFIG
Cause 1 of 2
An older Google Mobile Ads SDK still declares the property
1Check
The Mobile Ads SDK release notes say that version 24.0.0 (2025-02-24) removed the android.adservices.AD_SERVICES_CONFIG property tag from the SDK's manifest to prevent merge conflicts. Check which version the app resolves.
./gradlew :app:dependencies --configuration debugRuntimeClasspath | grep play-services-ads2Fix
Upgrade to 24.0.0 or later. If another library pulls an older copy in, raise it or add an explicit dependency on the newer version.
// app/build.gradle.kts, or the entry in your version catalog
dependencies {
implementation("com.google.android.gms:play-services-ads:24.0.0")
}3Verify
Rebuild. The conflict no longer appears in the manifest merger report.
./gradlew :app:processDebugMainManifest
grep -n "AD_SERVICES_CONFIG" app/build/outputs/logs/manifest-merger-debug-report.txtConfirmed by developers.google.com
Cause 2 of 2
Your manifest and a library set different resources for the same property
1Check
The manifest merger raises a conflict when both manifests set the same attribute to different values. The merged manifest view in Android Studio, or the merger report file, shows which value comes from where.
grep -n -B2 -A2 "AD_SERVICES_CONFIG" app/src/main/AndroidManifest.xml2Fix
Add a merge rule marker to your own property element. The Android documentation says tools:replace keeps the higher-priority manifest's value for each attribute you list, and your app's manifest has a higher priority than a library's. Declare the tools namespace on the manifest element if it is not there.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application>
<property
android:name="android.adservices.AD_SERVICES_CONFIG"
android:resource="@xml/my_ad_services_config"
tools:replace="android:resource" />
</application>
</manifest>3Verify
Rebuild and look at the merged manifest in the report. The property now carries your resource.
./gradlew :app:processDebugMainManifest
grep -n -A2 "AD_SERVICES_CONFIG" app/build/outputs/logs/manifest-merger-debug-report.txtConfirmed by developer.android.com
How do I stop it coming back?
- Keep the Google Mobile Ads SDK and Firebase libraries on current releases and read the release notes before an upgrade.
- Open the Merged Manifest tab after adding any SDK that ships its own manifest entries.
- Use tools:replace on the single attribute that conflicts, not tools:node="replace" on a whole element, so you do not drop children a library needs.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Mobile apps
Manifest merge fails because a library sets the same attribute as your app
Conflict error shown under Merging Errors in the Merged Manifest view
The manifest merger fails when your app and a library give the same attribute different values, such as android:icon on application.
3 causes, each with a fixMobile apps
adb cannot start because something already holds its port
adb start-server failed
The adb server must bind local TCP port 5037, and every adb client talks to it there.
2 causes, each with a fixMobile apps
The phone shows as unauthorized and Android Studio will not run the app
adb devices lists the phone but Android Studio cannot deploy to it
An unauthorized phone means it has not trusted this computer's RSA key.
3 causes, each with a fixMobile apps
Android Studio cannot pair the phone over Wi-Fi
The Pair devices over Wi-Fi dialog lists no device
Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.
4 causes, each with a fixMobile apps
adb cannot connect to its daemon or start the server
* daemon started successfully *
The adb server is a background process on your computer that listens on TCP port 5037.
2 causes, each with a fixMobile apps
adb prints 'server version doesn't match this client; killing...'
adb server version doesn't match this client; killing...
adb runs a background server, and every adb command is a client.
3 causes, each with a fix