23

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

Ali Raza
  • 1,183
  • 1
  • 10
  • 15

12 Answers12

48

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

Ali Raza
  • 1,183
  • 1
  • 10
  • 15
21

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.

Soufiane ROCHDI
  • 1,543
  • 17
  • 24
6

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.

der_michael
  • 3,151
  • 1
  • 24
  • 43
4

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

  • This tip saved my day - scratched my head all over couldn't figure out where to place it. Thanks for posting – mac_eric Feb 05 '21 at 08:06
4

As google mentioned in their guide under "Manual download" tab :

enter image description here

You must do the following :

Go to your project XCode >Targets > Build settings > Other linker flags and add "-ObjC" as shown in the guide :

enter image description here

Comes to think of it every one is trying to use the Admob using CocoaPods, tend to jump the manual download tab, but the issue is that the section related to "Other Linked Flags" is inside this last, so it must be separated in order to make it visible as a "To Do" step to accomplish the guide.

Enjoy;

mehdigriche
  • 444
  • 1
  • 4
  • 14
3

This way you can use. It worked for me for Google Mobile Ads SDK 8.1.0:

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxYOUR_IDxxxxx</string>
<key>NSUserTrackingUsageDescription</key>
    <string>This identifier will be used to deliver personalized ads to you.</string>
    <key>SKAdNetworkItems</key>
      <array>
        <dict>
          <key>SKAdNetworkIdentifier</key>
          <string>cstr6suwn9.skadnetwork</string>
        </dict>
      </array>
        <key>GADIsAdManagerApp</key>
        <true/>

All Ad Networks added: (https://developers.google.com/admob/ios/ios14)

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxYOUR_IDxxxxx</string>
<key>NSUserTrackingUsageDescription</key>
    <string>This identifier will be used to deliver personalized ads to you.</string>
    <key>SKAdNetworkItems</key>
<array>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>cstr6suwn9.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>4fzdc2evr5.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>2fnua5tdw4.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>ydx93a7ass.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>5a6flpkh64.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>p78axxw29g.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>v72qych5uu.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>c6k4g5qg8m.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>s39g8k73mm.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>3qy4746246.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>3sh42y64q3.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>f38h382jlk.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>hs6bdukanm.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>prcb7njmu6.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>wzmmz9fp6w.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>yclnxrl5pm.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>4468km3ulz.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>t38b2kh725.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>7ug5zh24hu.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>9rd848q2bz.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>n6fk4nfna4.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>kbd757ywx3.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>9t245vhmpl.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>2u9pt9hc89.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>8s468mfl3y.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>av6w8kgt66.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>klf5c3l5u5.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>ppxm28t8ap.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>424m5254lk.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>uw77j35x4d.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>e5fvkxwrpn.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>zq492l623r.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>3qcr597p9d.skadnetwork</string>
    </dict>
</array>
        <key>GADIsAdManagerApp</key>
        <true/>
Mahmut K.
  • 707
  • 1
  • 8
  • 20
1

Do not forget these steps on iOS. That solved the problem for me.

"This step is required as of Google Mobile Ads SDK version 7.42.0."

M_droid
  • 2,447
  • 2
  • 25
  • 35
1

So, for my case, I had 2 targets, 1 pro app and another free app. And I added the GADthingamabob key in the Info.plist file found under left panel. Turns out this one only updates the Pro app info plist. What you need to do is to select the Lite target, and then goto Info panel and add the GADthingamabob there then it no longer crashes. I don't even need to add GADIsAdManagerApp thingy.

enter image description here

GeneCode
  • 7,545
  • 8
  • 50
  • 85
  • 1
    Same problem, thanks! – Mona Dec 12 '21 at 08:31
  • I had moved the info.plist file to a new location and didn't update the address under build setting so the app couldn't locate the file to access the info.plist data – Mona Dec 20 '21 at 20:47
0

on info.plist always use your actual project id.(ca-app-pub-xxxxYOUR_IDxxxxx)

and if you're debugging then at the time of instantiation of GADBannerView, use the dummy adUnitID("ca-app-pub-3940256099942544/2934735716")

make sure you replace this dummy adUnitID by your actual project id.

for more detailed information, please visit:- google admob documentation

Vipul Kumar
  • 893
  • 9
  • 19
0

To do it, simply

  1. Go to Info.plist in your runner folder and click on the " + " button next to the properties list. Add GADApplicationIdentifier property of type string and set its value to the AdMob app ID but not unit ID.

  2. Again click on " + " next to the properties list. Add SKAdNetworkItems and change its type to an array.

  3. Inside SKAdNetworkItems add a new property with the name SKAdNetworkIdentifier with the value cstr6suwn9.skadnetwork

It should work fine.

0
  1. Delete 'GADApplicationIdentifier' and it's VALUE from Info.plist
  2. Add 'GADApplicationIdentifier' and it's VALUE manually again
  3. Build an App
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 24 '22 at 06:03
0

Add key, value in info-plist

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxx/xxxxxx</string>
<key>GADIsAdManagerApp</key>
<true/>
ArNo
  • 2,278
  • 1
  • 22
  • 19