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
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
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.
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.
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
As google mentioned in their guide under "Manual download" tab :
You must do the following :
Go to your project XCode >Targets > Build settings > Other linker flags and add "-ObjC" as shown in the guide :
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;
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/>
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.
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."
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
To do it, simply
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.Again click on " + " next to the properties list. Add
SKAdNetworkItems
and change its type to an array.Inside SKAdNetworkItems add a new property with the name
SKAdNetworkIdentifier
with the valuecstr6suwn9.skadnetwork
It should work fine.
- Delete 'GADApplicationIdentifier' and it's VALUE from Info.plist
- Add 'GADApplicationIdentifier' and it's VALUE manually again
- Build an App
Add key, value in info-plist
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxx/xxxxxx</string>
<key>GADIsAdManagerApp</key>
<true/>
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.
© 2022 - 2024 — McMap. All rights reserved.