본문 바로가기
Programing/android

[android] Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider 오류 error

by TEXTBOX 2021. 12. 6.
728x90

구글 광고를 달았다가 다른 광고로 변경을 하니 아래와 같은 오류가 발생하였다.

 

2021-12-06 10:45:54.491 20487-20487/? E/Zygote: isWhitelistProcess - Process is Whitelisted
2021-12-06 10:45:54.493 20487-20487/? E/Zygote: accessInfo : 1
2021-12-06 10:45:54.491 20487-20487/? E/Zygote: isWhitelistProcess - Process is Whitelisted
2021-12-06 10:45:54.493 20487-20487/? E/Zygote: accessInfo : 1
2021-12-06 10:45:54.528 20487-20487/? E/com.amadas.cal: Unknown bits set in runtime_flags: 0x8000
2021-12-06 10:45:54.491 20487-20487/? E/Zygote: isWhitelistProcess - Process is Whitelisted
2021-12-06 10:45:54.493 20487-20487/? E/Zygote: accessInfo : 1
2021-12-06 10:45:54.528 20487-20487/? E/com.amadas.cal: Unknown bits set in runtime_flags: 0x8000
2021-12-06 10:45:55.307 20487-20487/com.amadas.calc E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.amadas.calc, PID: 20487
    java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException: 
    
    ******************************************************************************
    * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers    *
    * should follow the instructions here:                                       *
    * https://googlemobileadssdk.page.link/admob-android-update-manifest         *
    * to add a valid App ID inside the AndroidManifest.                          *
    * Google Ad Manager publishers should follow instructions here:              *
    * https://googlemobileadssdk.page.link/ad-manager-android-update-manifest.   *
    ******************************************************************************
    
    
        at android.app.ActivityThread.installProvider(ActivityThread.java:7769)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:7309)
        at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7166)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7134)
        at android.app.ActivityThread.access$1600(ActivityThread.java:274)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2102)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8167)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
     Caused by: java.lang.IllegalStateException: 
    
    ******************************************************************************
    * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers    *
    * should follow the instructions here:                                       *
    * https://googlemobileadssdk.page.link/admob-android-update-manifest         *
    * to add a valid App ID inside the AndroidManifest.                          *
    * Google Ad Manager publishers should follow instructions here:              *
    * https://googlemobileadssdk.page.link/ad-manager-android-update-manifest.   *
    ******************************************************************************
    
    
        at com.google.android.gms.internal.ads.zzbhw.attachInfo(com.google.android.gms:play-services-ads-lite@@20.3.0:20)
        at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite@@20.3.0:1)
        at android.app.ActivityThread.installProvider(ActivityThread.java:7764)
        	... 11 more

 

내용을 보니 구글 admob sdk는 참조가 되었으나 androidmanifest.xml 파일에 app id가 누락되어서 난게 아닐까
생각했다.

그런데 구글 sdk를 제거한 상태고 layout상에서도 adview를 제거한 상태였다.
어딘가에 찌꺼기가 남아서 오류가 난 것일까 하고 비슷한 케이스가 있는지 검색해 보았다.

찾다보니 stack overflow에서 비슷한 글을 확인했다.

구글mob에서 앱 id를 찾아서 androidmanifest.xml에 추가를 하던지 아니면 아래와 같은 태그를 추가하여 빌드를
시키면 된다는 것이였다.

<meta-data
            android:name="com.google.android.gms.ads.AD_MANAGER_APP"
            android:value="true"/>

 

<application>... </application> 에 위 태그를 추가하고 빌드한 결과 정상적으로 빌드가 되었다.

 

728x90

댓글