본문 바로가기
프레임워크/Flutter

[Flutter]Error Manifest merger failed

by 연어바케트 2025. 1. 14.
반응형

 

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

FAILURE: Build failed with an exception.

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

 

구글 Admob을 추가하고 빌드하는 도중 AndroidManifest에서 위와 같은 에러가 발생하였는데, 아래와 같이 코드를 추가 하면 된다. 

 

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.your.package.name">

    <application>
        <!-- AdMob 설정 -->
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="@string/google_ad_mob_id" />

        <!-- 충돌 해결 -->
        <property
            android:name="android.adservices.AD_SERVICES_CONFIG"
            android:resource="@xml/gma_ad_services_config"
            tools:replace="android:resource" />
    </application>
</manifest>

 

꼭 xmlns:tools="http://schemas.android.com/tools" 를 추가 해야한다

반응형

댓글