Android: AdMob not working

admob ads not showing android studio
admob ads are not shown in real device
admob android
admob test ads not showing
add test device admob android
admob banner
admob test ads not showing unity
how to add admob ads in android app

AdMob won't show in my app. Every time I invoke loadAd(..) I get the following errors:

Requesting resource 0x7f0b000e failed because it is complex. The Google Play services resources were not found. Check your project configuration to ensure that the resources are included. There was a problem getting an ad response. ErrorCode: 1

I searched hours for a solution to this problem but haven't found anything that works for me! I downloaded the latest version of the Google Play Services and added them as library in my project preferences

Here is my code: Activity:

public class WelcomeActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.activity_welcome);

        // Look up the AdView as a resource and load a request.
        AdView adView = (AdView) this.findViewById(R.id.welcomeAdView);

        AdRequest.Builder adRequestBuilder = new AdRequest.Builder();
        adRequestBuilder.addTestDevice("************"); 
        adRequestBuilder.addTestDevice(AdRequest.DEVICE_ID_EMULATOR);
        AdRequest adRequest = adRequestBuilder.build();
        adView.loadAd(adRequest);
    }

}

Layout xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res/xx.xx"
    android:id="@+id/container"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    tools:context="xx.xx.WelcomeActivity" >

.... other layout stuff .....

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_alignParentBottom="true" >

    <com.google.android.gms.ads.AdView
        android:id="@+id/welcomeAdView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        ads:adSize="BANNER"
        ads:adUnitId="pub-***************" />
</RelativeLayout>

</RelativeLayout>

AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="xx.xx"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="19" />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Holo.Light" >
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name="xx.xx.WelcomeActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        ... some more activities ...
        <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" >
        </activity>
    </application>

</manifest>

I don't find any issue with your code/layout. Issue could be with the Ads Unit Id.

I would suggest you to try creating a different Ads Unit Id

Hope it works.

Common reasons for ads not showing, (Android, iOS, Unity). Ads won't show in apps that aren't set up correctly. Have you integrated the Google Mobile Ads SDK correctly? Take  My Android game was published on the Google's market, but I didn't get any impressions from AdMob. There was no significant changes in the code, or even changes at all that touched AdMob sources and the previous versions of my game were working properly.

Just adding this in case someone else has the same problem as mine.

I tried using a new Ads Unit ID and that didn't work as well. In the end, the issue was because I was trying to fix an app that got suspended from Google Play and Admob had also actually stopped serving ads to applications with the specific package name / bundle ID.

Changing the package name of the application solved the issue for me.

Why are my ads not showing, why not show my ads please solved my problem admob team my app (2 March 2019), Ads stop showing in both iOS & Android version. Questions: AdMob won’t show in my app. Every time I invoke loadAd(..) I get the following errors: Requesting resource 0x7f0b000e failed because it is complex. The Google Play services resources were not found.

Be careful of the ad-unit id string. My error was a space in the end of the adUnitId

Why aren't my Admob ads showing? – QuickAppNinja Help Center, You've monetized your app with Admob, but your ads aren't showing test ads here - https://developers.google.com/admob/android/test-ads)  You’ve monetized your app with Admob, but your ads aren’t showing when you test your game. Here are some common causes and how to fix them: Make sure you have a valid Game's Website URL in the Google Play listing. Learn more about it. Make sure you have updated AdMob with your payment details.

In your layout file (activity_welcome.xml), the adview container (RelativeLayout) layout width/height looks strange to me. And I think it is useless in your use case. Change from:

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_alignParentBottom="true" >

    <com.google.android.gms.ads.AdView
        android:id="@+id/welcomeAdView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        ads:adSize="BANNER"
        ads:adUnitId="pub-***************" />
</RelativeLayout>

to:

<com.google.android.gms.ads.AdView
    android:id="@+id/welcomeAdView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    ads:adSize="BANNER"
    ads:adUnitId="pub-***************" />

Integrate Google Admob, With that, I have also downloaded the example google apps for admob, they work with test ads but not with my unit and app IDs. Where can I  Unfortunately I have the same problem i run my android app with debug apk and add adTestDevice with a number device and unit id from admob and when I upload to play store does not appear anything. Thanks in advance

You used wrong ads:adUnitId="pub-***************". It must looks like ca-app-pub-3940256099942544/6300978111 format. You can take it after creating banner by url https://apps.admob.com/#monetize/adunit:create

Admob real ads not showing., When I run my game I get this : INFO:ADMOB: init but ads doesn't show on the screen. Also I set my Android App Id in the game project file. Google has requested to not use that code (you have used previously) when your app is in development mode. May be your add id has been dismissed. Try some other email and create another add request. – Ashish TiwariSep 26 '15 at 6:07

Admob banner ads not working (Flutter and Java not working, but , I'm using AdMob for showing Android ads. The test ads are working fine but real ads are not shown. I was searching for this reason since 2-3 days and came to know strange about this issue this is not a programming issue it is actually admob settings if you have not submitted payment account details then ads are not enabled so if you have new account then you must fill payment account details to enable ads, it will take arround 24 hrs to activate. kindly check below link. support.google.com/admob/answer/7652476?hl=en – Ghanshyam Bagul Oct 28 '19 at 15:41

AdMob ads not showing up (SOLVED) - Questions, hi there, I have some android apps on Amazon app store, also I have the same apps on Google play store, the problem is that admob ads are  I'm using admob for showing android ads. The test ads are working fine but real ads are not shown. Also, I've no issue with real interstitial ads as they work fine. Just the real banner ads are not showing up. My java code is

Why does AdMob's ad not show? I'm using AdMob for showing , Admob banner ads are not showing up. I have tried 4.21, 4.22, and 4.23, both upgrading my project as well as creating a brand new project. My project is a Blueprint project, no source or cpp.

Comments
  • Just in case, are you using a webViewInstance and have you issued some method like .pauseTimers(), or some similar method that pauses certain execution of the main UI?
  • I don't see any issue with the code/layout. I would suggest you to try creating a different ads UnitId
  • @Libin: I created a new ad UnitID and now it works! Thanks! Post your comment as anser and I will award the bounty on it :)
  • @Markus - Added as answer :)
  • I am having the same issue. Its working if a add someone else's unit id but not working with my unit id. I am using NativeExpressAdView
  • Hi, I have exact the same issue. But how can I create a new Ads Unit Id? Admob looks new to me and I dont get which ID I have to take
  • In the email they sent initially, the adUintId only had up to the forward slash. Getting the full ID from the Monetize tab fixed my issue.
  • Thanks for your reply. Unfortunately my Manifest.xml already contains this meta data. I added the AndroidManifest.xml to my question
  • It's very rare my friend :(