khstar

Terminating app due to uncaught exception 'GADInvalidInitializationException' 오류 수정 본문

개발/iOS&iPhone&iPad

Terminating app due to uncaught exception 'GADInvalidInitializationException' 오류 수정

khstar 2019. 5. 22. 14:33
반응형

오늘 CocoaPods를 업데이트 했습니다. 업데이트를 하고 Test를 돌리니 

*** 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' 

 

에러가 발생하며 Crash 되네요. 

내용을 보면 Google Admob에서 발생하는 오류입니다.

 

Info.plist에 key=GADApplicationIdentifier, value= 앱 ID 를 추가해 주시면 됩니다.

앱 ID는 AdMob에서 확인하시면 됩니다.

다음과 같이 Info.plist에 Key, Value를 추가합니다.

또한 기존에 GADMobileAds.configure 가 Deprecated 된다고 합니다. 

기존 GADMobileAds.configure를 GADMobileAds.sharedInstance().start로 수정해 주어야 합니다.

 

기존 : GADMobileAds.configure(withApplicationID: "앱 ID")

수정 : GADMobileAds.sharedInstance().start(completionHandler: nil)

 

이렇게 하면 Google AdMob 관련 오류는 사라질것 입니다.

 

참조 : 

https://hckim999.tistory.com/14

https://developers.google.com/admob/ios/quick-start#update_your_infoplist

반응형
Comments