Why tests adds not appearing?

57 views
Skip to first unread message

ecologicalsof...@gmail.com

unread,
Nov 30, 2017, 9:22:07 AM11/30/17
to Google Mobile Ads SDK Developers
Dear all,

I wish to seek advice as to why adverts are not appearing on the Nexus 5 emulator that comes with Android Studio. I have added the following code to one of my fragments: This is the first time that I have made use of adverts in my app. 

The Fragment is called "Selected Species"

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.selectedspecies, container, false);

recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
layoutManager = new LinearLayoutManager(this.getContext());
recyclerView.setLayoutManager(layoutManager);

MobileAds.initialize(this.getContext(),"ca-app-pub-4826760022871008~7701513470");

mAdView1 = (AdView) view.findViewById(R.id.adView1);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView1.loadAd(adRequest);

mAdView2 = (AdView) view.findViewById(R.id.adView2);
AdRequest adRequest2 = new AdRequest.Builder().build();
mAdView2.loadAd(adRequest2);

if (savedInstanceState != null) {
ArrayChar = savedInstanceState.getStringArray("ArrayChar");
}


The selectedspecies XML layout is as follows:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.ebookfrenzy.GramineaeIdentification.SelectedSpecies">

<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView1"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-4826760022871008/4709885603">
</com.google.android.gms.ads.AdView>

<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:scrollbarSize="20dp"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbarStyle="insideInset"/>

<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView2"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-4826760022871008/4709885603">
</com.google.android.gms.ads.AdView>

</android.support.design.widget.CoordinatorLayout>


The build.gradle file is as follows:

compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:design:25.4.0'
compile 'com.android.support:support-v4:25.4.0'
compile 'com.android.support:cardview-v7:25.4.0'
compile 'com.android.support:recyclerview-v7:25.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-ads:11.6.2'
testCompile 'junit:junit:4.12'

Many thanks,
Alasdair Grant 

Deepika Uragayala- MobileAds SDK team

unread,
Nov 30, 2017, 2:57:02 PM11/30/17
to Google Mobile Ads SDK Developers
Hi Alasdair,

Thanks for contacting us. This might be an issue with your emulator. Can you please make sure that you have selected Google APIs when creating your Nexus 5 emulator via Android Studio? I don't see anything wrong with your code snippet but just to confirm, can you first try with our sample apps and then let us know if you are able to receive test ads? Also, you can use our test Ad Unit IDs  to see if there is any issue with your Ad Unit ID/AdMob Account.

Regards,
Deepika Uragayala
Mobile Ads SDK Team

Zap

unread,
Nov 30, 2017, 5:30:29 PM11/30/17
to Google Mobile Ads SDK Developers
Hello, can you share what happens when you login to AdMob and open "Payments"

I read that you need Payments configured from AdMob website before any ads will always appear correctly.


On Thursday, November 30, 2017 at 9:22:07 AM UTC-5, ecologicalsof...@gmail.com wrote:

Deepika Uragayala- MobileAds SDK team

unread,
Dec 1, 2017, 2:38:41 PM12/1/17
to Google Mobile Ads SDK Developers
Hi Zap,

As mentioned by my colleague in the other thread that you have opened, we would not be able to provide support for account related queries as our team deals with technical SDK related queries only.  However, you can go through this help center page and see if this information helps.

As an alternative, you may use the Feedback button found on the AdMob Dashboard if you have any issues with the AdMob website as suggested in the original post.

Regards,
Deepika Uragayala
Mobile Ads SDK Team


Zap

unread,
Dec 2, 2017, 11:45:27 PM12/2/17
to Google Mobile Ads SDK Developers
Yeah, I've tried sending feedback. I've tried calling Google. I've tried posting on forums.
Please ask your colleagues in AdMob to mesage me and investigate my account, because the Payments page shows error:

Reply all
Reply to author
Forward
Message has been deleted
0 new messages