Reputation: 191
I am currently using the com.google.android.gms:play-services-ads library in my Android application. However, the application does not display any AdMob ads; it simply uses this library to retrieve the Google Advertising ID from ads delivered through the IMASDK.
I recently updated to the latest version of com.google.android.gms:play-services-ads since the old version is being phased out. After doing so, I started receiving an error in the Google Play Console stating that the AdMob APPLICATION_ID is not present in the manifest.
As I understand it, as of version 17.0.0, the Google Mobile Ads SDK (included in com.google.android.gms:play-services-ads) requires an AdMob App ID to initialize, which is likely the root cause of this error. However, creating an AdMob account is not an option for me as my app is not serving AdMob ads at all and it is a client's requirement.
Is there a way to resolve the "AdMob APPLICATION_ID not present in the manifest" error without adding an AdMob App ID in the manifest file?
If I were to use a dummy AdMob App ID, like ca-app-pub-0000000000000000~0000000000, what would the potential repercussions be? Could this potentially break something in my app or cause any issues?
Thanks in advance for your help!
Upvotes: 1
Views: 4050
Reputation: 111
You need to create AdMob account to run live Admob ads in your app. If you really don't want to create AdMob account, you can use the following TEST AdMob App ID and TEST Ad Unit ID for banner ads. Remember that this will only display test ads and not generate revenue for you. If you want to earn from it, you really need to create AdMob account. Add this to your manifest:
<application>
<!-- Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>
</application>
This should fix the error you're receiving since AdMob APPLICATION_ID is now present in your manifest file. To start displaying banner ads, use this test ad unit, "ca-app-pub-3940256099942544/6300978111"
There are also test IDs for other formats of ads. The following link provides the test IDs you can use for different ad formats: Enabling test ads by Google Admob
Upvotes: 0