0

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!

Mikhail
  • 133
  • 2
  • 9

1 Answers1

0

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

Vez Droid
  • 1
  • 2
  • Thank you for the reply. As I mentioned in the question, the app I working at not using AdMob for providing ads. It uses IMASDK to get custom ads from our app partners. We need `com.google.android.gms:play-services-ads` only for getting the id of the ads the app is displaying, not for the display of AdMob ads. Your idea of using a test app id is interesting, but I have a concern that it can potentially lead to some misbehavior in the `com.google.android.gms:play-services-ads` functionalyty, and have no idea how to check if all is still working ok or not – Mikhail May 19 '23 at 08:45
  • It seems to me that Google needs an app ID to identify your app and obtain its performance information that they can then display in your Admob dashboard. If you don't need all of that, then I think you can just proceed to use the sample app ID. I also don't think the sample App ID that the official documentation provided can lead to issues. We need it to at least initialize the library. Use the test app ID they provided and then see if you can still get the ad IDs. If you're getting the ad IDs, that only means that there should be no problem using just the sample App ID in your app. – Vez Droid May 19 '23 at 10:29
  • Thank you for the update. It seems impossible to use a test app id like you suggested `android:value="ca-app-pub-3940256099942544~3347511713"`. The app crashes with the message that the `App id not correct` – Mikhail May 22 '23 at 06:20
  • @Mikhail if you're using IMA SDK, you'll want to depend on [play-services-ads-identifier](https://maven.google.com/web/index.html?q=play-services-ads#com.google.android.gms:play-services-ads-identifier:18.0.1), not `play-services-ads`. Then you won't need the AdMob App ID. – Eric Leichtenschlag May 23 '23 at 22:35
  • Thank you for the reply. I should have mentioned it in the question, I already tried to use the `play-services-ads-identifier` only dependency. Google Play console still was displaying errors the same way as with `play-services-ads`. Error is gone only if add dummy AdMob App ID or if to remove `play-services-ads` from project – Mikhail May 24 '23 at 00:34