Manifest merger failed : Attribute property#android.adservices.AD_SERVICES_CONFIG Error in Android Studio Iguana
Asked Answered
C

2

12

I am trying add AdMob ads in my app. when I add AdMob dependency and implement ads after when I run the app I got this error.

Manifest merger failed : Attribute property#android.adservices.AD_SERVICES_CONFIG@resource value=(@xml/ga_ad_services_config) from [com.google.android.gms:play-services-measurement-api:21.6.2] AndroidManifest.xml:32:13-58
    is also present at [com.google.android.gms:play-services-ads-lite:23.0.0] AndroidManifest.xml:92:13-59 value=(@xml/gma_ad_services_config).
    Suggestion: add 'tools:replace="android:resource"' to <property> element at AndroidManifest.xml to override.

When I see Merged Manifest here is also error

Merge Errors Error: Attribute property#android.adservices.AD_SERVICES_CONFIG@resource value=(@xml/ga_ad_services_config) from AndroidManifest.xml:32:13-58 is also present at AndroidManifest.xml:92:13-59 value=(@xml/gma_ad_services_config). Suggestion: add 'tools:replace="android:resource"' to <property> element at AndroidManifest.xml to override. cryptotradingsignals.app main manifest (this file), line 31

I also Add this in manifest still got error but different error

tools:replace="android:resource"

Any Idea how to solve?

I am looking for a result to solve my error in android latest version Laguana

Canaster answered 19/4 at 1:39 Comment(2)
I'm facing a similar issue when using app-lovin mediation admob adapter ( 22.6.0.0 )Farlee
Same problem here when using com.google.android.gms:play-services-ads:23.0.0. Going back to com.google.android.gms:play-services-ads:22.3.0 works but it is not my preferred way to go. I would be happy about a solution with the latest ads version.Patina
P
12

I added the following code in AndroidManifest.xml. Not sure if this is the final solution, but it works for me now.

    <property
        android:name="android.adservices.AD_SERVICES_CONFIG"
        android:resource="@xml/gma_ad_services_config"
        tools:replace="android:resource" />
    ...  
</application>
Patina answered 21/4 at 19:21 Comment(0)
F
1

Going back to 22.3.0 admob dependency solved it for me

Farlee answered 19/4 at 20:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.