Android Project problem when implementing admob

80 Views Asked by At

Error Code:

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.5.1] 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.


dependencies {

implementation 'androidx.appcompat:appcompat:1.5.1'

implementation 'com.google.android.material:material:1.6.1'


implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation(platform("com.google.firebase:firebase-bom:32.7.4"))
implementation("com.google.firebase:firebase-analytics")
implementation 'com.google.firebase:firebase-database:20.3.0'
implementation 'com.google.android.gms:play-services-ads:23.0.0'

}

I am using firebase database and having problem when i try to add google services-ads

1

There are 1 best solutions below

0
Divakar Thakur On

Add the property in manifest on application tag.

<application
   ...
   <property android:name="android.adservices.AD_SERVICES_CONFIG"
        android:resource="@xml/gma_ad_services_config"
        tools:replace="android:resource"/>
</application>