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
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
This actually works! I've got GADApplicationIdentifier already and still having the problem, adding GADIsAdManagerApp works!
This is not the correct way to solve this issue.
Worked for me, too. So, if "This is not the correct way to solve this issue", please enlighten us.
This key is for ad publishers, not for the client apps!
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.
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 tags on same line e.g.
your identifierPlease 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.
This was the mistake I was making - thank you!
Thanks I was also making that mistake. The app id can be found here: support.google.com/admanager/answer/1656921#copy-id
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;
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
I have tried this but it does not work.
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/>It does not work for me. I used CocoaPods.
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.
Same problem, thanks!
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
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."
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 value cstr6suwn9.skadnetwork
It should work fine.
I am not sure the need to add how many items in the array and I added 49. But still cannot. I have added the app ID ca-app-pub-xxxx?xxxx or xxxxx/xxxx still cannot.
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.
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
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.
I have tried this and still cannot
Add key, value in info-plist
<key>GADApplicationIdentifier</key> <string>ca-app-pub-xxxxxxxxxxxx/xxxxxx</string> <key>GADIsAdManagerApp</key> <true/>