When I try implementing admit to android application am running into this error.If I insert test device hash I only see admob testing ads only. When I comment out test for production this is the error I get on the Error log
W/Ads: There was a problem getting an ad response. ErrorCode: 0
W/Ads: Failed to load ad: 0
Here is my code code for implementing the advert
public void showAds() {
String deviceId = MGUtilities.getDeviceID(getApplicationContext());
Log.e("DEVICE ID", "------------------------------------------");
Log.e("DEVICE ID", deviceId);
Log.e("DEVICE ID", "------------------------------------------");
FrameLayout frameAds = (FrameLayout) findViewById(R.id.frameAds);
if (Config.WILL_SHOW_ADS) {
frameAds.setVisibility(View.VISIBLE);
if (adView == null) {
adView = new AdView(this);
adView.setAdSize(AdSize.SMART_BANNER);
adView.setAdUnitId(Config.BANNER_UNIT_ID);
frameAds.addView(adView);
AdRequest.Builder builder = new AdRequest.Builder();
if (Config.TEST_ADS_USING_TESTING_DEVICE)
builder.addTestDevice(Config.TESTING_DEVICE_HASH);
if(Config.TEST_ADS_USING_EMULATOR)
builder.addTestDevice(AdRequest.DEVICE_ID_EMULATOR);
AdRequest adRequest = builder.build();
// Start loading the ad in the background.
adView.loadAd(adRequest);
}
} else {
frameAds.setVisibility(View.GONE);
}
}
What might be wrong? Thanks.