Ads SDK was initialized without an application ID
Asked Answered
C

13

24

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

Caniff answered 16/10, 2019 at 4:44 Comment(0)
C
50

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

Caniff answered 16/10, 2019 at 4:44 Comment(4)
This actually works! I've got GADApplicationIdentifier already and still having the problem, adding GADIsAdManagerApp works!Disbranch
This is not the correct way to solve this issue.Bozen
Worked for me, too. So, if "This is not the correct way to solve this issue", please enlighten us.Iain
This key is for ad publishers, not for the client apps!Sirkin
M
23

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.

Mogilev answered 24/3, 2020 at 23:8 Comment(1)
In my case, I copied the identifier with newline character at the end. To make sure you don't have any unnecessary characters, write your identifier and <string> tags on same line e.g. <string>your identifier</string>Solitaire
B
7

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.

Bozen answered 22/1, 2021 at 7:19 Comment(1)
This was the mistake I was making - thank you!Pisarik
R
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

Regin answered 3/2, 2021 at 23:44 Comment(1)
This tip saved my day - scratched my head all over couldn't figure out where to place it. Thanks for postingSaunderson
L
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;

Lareine answered 14/2, 2021 at 9:27 Comment(0)
B
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/>
Backlash answered 24/2, 2021 at 20:42 Comment(0)
S
2

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

Scotland answered 6/12, 2020 at 12:4 Comment(2)
Same problem, thanks!Midi
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 dataMidi
C
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."

Commonly answered 28/9, 2020 at 13:58 Comment(0)
C
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

Comanche answered 27/9, 2021 at 6:27 Comment(0)
F
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.

Forgave answered 31/5, 2022 at 10:58 Comment(0)
F
0
  1. Delete 'GADApplicationIdentifier' and it's VALUE from Info.plist
  2. Add 'GADApplicationIdentifier' and it's VALUE manually again
  3. Build an App
Fleetwood answered 21/7, 2022 at 21:31 Comment(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.Aldrich
C
0

Add key, value in info-plist

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxx/xxxxxx</string>
<key>GADIsAdManagerApp</key>
<true/>
Condescend answered 27/9, 2022 at 15:51 Comment(0)
L
0

After adding GADApplicationIdentifier & SKAdNetworkItems values in Info.plist, you have to also add -ObjC Linker Flags. Open project's build settings and search for linker. From Other Linker Flags, add -ObjC flag for both debug and release.

Linker Flags settings

Larkin answered 13/11, 2023 at 3:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.