Search code examples
admobandroid-manifestgodot

How to use multiple AdMob unit ids in one android manifest file


I have been trying to add ads in my game using admob but i have hit a wall. I have been trying to use multiple ad units in my app but i keep getting errors. Here are my problems:

  1. In the android manifest file i have added: <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3940256099942544/5224354917"/> i am a little confused on what i should put in "APPLICATION_ID". any help?
  2. I have multiple ad units and i want to use both intertisial and rewarded ads in my game but it gives me an error if i try to add two tags saying that "com.google.android.gms.ads.APPLICATION_ID" is duplicated. I have been trying for days and cant figure it out.

I tried to add two meta data tags but to no avail. I dont know how to add two add units in my app and am a beginner in android development so any help will be appreciated.


Solution

  • Add one time this meta-data tag in your manifest like this

    enter image description here

    And put your ad ids in your string file like this

    enter image description here

    And use like this

    enter image description here