본문 바로가기
Mobile

[ Ionic ] GADInvalidInitializationException Error 수정

by 기저귀찬개발자 2020. 8. 27.
2020-08-27 16:49:15.490630+0900 Reflex Game[479:92225] 
*** Terminating app due to uncaught exception 'GADInvalidInitializationException', 
reason: 'The Google Mobile Ads SDK was initialized incorrectly.
Google AdMob publishers should follow instructions here: 
https://googlemobileadssdk.page.link/admob-ios-update-plist to include the 
AppMeasurement framework, set the -ObjC linker flag, and set GADApplicationIdentifier 
with a valid App ID. Google Ad Manager publishers should follow instructions here: 
https://googlemobileadssdk.page.link/ad-manager-ios-update-plist'

 

기존에 안드로이드에 배포한 앱에 대해서 아이폰으로 배포하기 위해서 빌드 중에 위와 같은 에러가 나타났다.

이유는 App ID를 ios로 빌드한 plist 파일에서 찾을 수 없어서 나타난 현상인다.

config.xml에 아래와 같이 해당 값들을 추가하여 수정하였다.

platform 내부의 plist에 직접 추가할 수 있지만 빌드하면 초기화되니 config.xml에 추가하여야한다.

 

    <platform name="ios">
        <edit-config file="*-Info.plist" mode="merge" target="GADIsAdManagerApp">
            <true />
        </edit-config>
        <edit-config file="*-Info.plist" mode="merge" target="GADApplicationIdentifier">
            <string>{{구글ID}}</string>
        </edit-config>
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />

 

댓글