Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ads SDK was initialized without an application ID

Terminating app due to uncaught exception 'GADInvalidInitializationException', reason: 'The Google Mobile Ads SDK was initialized without an application ID. Google AdMob publishers, follow instructions here: https://googlemobileadssdk.page.link/admob-ios-update-plist to set GADApplicationIdentifier with a valid App ID. Google Ad Manager publishers, follow instructions here: https://googlemobileadssdk.page.link/ad-manager-ios-update-plist

like image 494
Ali Raza Avatar asked Oct 16 '19 04:10

Ali Raza


5 Answers

you can work around it by adding the key-value pair in the documentation linked above to your Info.plist file.

Open your info.plist file and put that line:

key = GADIsAdManagerApp

value = true

like image 142
Ali Raza Avatar answered Oct 17 '22 23:10

Ali Raza


This step is required as of Google Mobile Ads SDK version 7.42.0. Failure to add add this Info.plist entry results in a crash with the message: The Google Mobile Ads SDK was initialized incorrectly.

In your app's Info.plist file, add a GADApplicationIdentifier key with a string value of your AdMob App ID

  1. A GADApplicationIdentifier key with a string value of your AdMob app ID (identified in the AdMob UI).

  2. A SKAdNetworkItems key with Google's SKAdNetworkIdentifier value of cstr6suwn9.skadnetwork.

You can make this change programmatically:

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3940256099942544~1458002511</string>
<key>SKAdNetworkItems</key>
  <array>
    <dict>
      <key>SKAdNetworkIdentifier</key>
      <string>cstr6suwn9.skadnetwork</string>
    </dict>
  </array>

Or, edit it in the property list editor:

enter image description here

Key Point: In a real app, it is important that you use your actual AdMob app ID, not the one listed above. If you're just looking to experiment with the SDK in a Hello World app, though, you can use the sample app ID shown above.

like image 38
Paresh Mangukiya Avatar answered Sep 21 '22 07:09

Paresh Mangukiya


An update is made, see the official link: https://firebase.google.com/docs/admob/ios/quick-start#add-app-id-to-info-plist

You should add the following pair (key, value) to your Info.plist file:

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3940256099942544~1458002511</string><!-- add your AdMob app ID-->

I hope this will help.

like image 16
Soufiane ROCHDI Avatar answered Oct 17 '22 23:10

Soufiane ROCHDI


Please make sure that you add your actual admob app id in Info.plist and not an ad id. If you use an ad id as app id in the Info.plist, the SDK will crash.

like image 4
der_michael Avatar answered Oct 17 '22 22:10

der_michael


In my case, I misspelled -ObjC. Check the capital letters and the hyphen, as well as the position where you write it. You should write it in: Other Linker Flags in your project's build settings

like image 4
Sergio Strati Avatar answered Oct 17 '22 23:10

Sergio Strati