admob ads doesnt appear in android studio and in the generated apk in my phone

11 views
Skip to first unread message

gameel...@gmail.com

unread,
Sep 18, 2018, 6:18:03 PM9/18/18
to Google Mobile Ads SDK Developers

Hi, I can not show ads on android studio and on my phone, I followed all the steps and I created ads and IDs on Admob but they do not show, here is the source code detail:

build.gardle file:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.jaredrummler:android-processes:1.0.3'
compile 'com.google.android.gms:play-services-ads:11.0.0'


}
content_main.xml file:
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-XXXXXXXXXXXXXXX/XXXXXXXXXX">
</com.google.android.gms.ads.AdView>
</RelativeLayout>

Class :
public class MainActivity extends BaseActivity {

public static final String PARAM_TOTAL_SPACE = "total_space";
public static final String PARAM_USED_SPACE = "used_space";
public static final String PARAM_TOTAL_MEMORY = "total_memory";
public static final String PARAM_USED_MEMORY = "used_memory";
private AdView mAdView;

private Button mJunkCleanButton;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MobileAds.initialize(this, "ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXXXXX");

mAdView =(AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().addTestDevice(AdRequest.DEVICE_ID_EMULATOR).build();
mAdView.loadAd(adRequest);

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
........

mobileadssdk-a...@google.com

unread,
Sep 18, 2018, 11:34:32 PM9/18/18
to gameel...@gmail.com, Google Mobile Ads SDK Developers
Hi,

Let's continue our investigation from this thread instead.

Please provide in that thread your new findings based from the requested information so we can narrow down the root cause of the issue encountered on your end.

Regards,
Ivan Bautista
Mobile Ads SDK Team



--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/8264e1a9-3e19-4eb2-9449-149409cbf3eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages