I am integrating AdMob in my android app. The code for the add part is pretty simple and almost straight from Google Developer's guide. I am trying to implement Interstitials. The ads are showing fine but I am getting this in stackTrace in red:
E/Ads(21443): JS: Uncaught ReferenceError: AFMA_ReceiveMessage is not defined (null:1)
Can anyone tell me what it means? Is it ok to release the app with this error as it doesn't crash the app?
EDIT: I just noticed that this error is being received for a specific ad and not for the other(just getting two ads in my country for now). So maybe it's just something missing from Publisher end.
If this is the testing device you should call AddTestDevice("your tester device code you can got it from logCat when you start the App")
.
If not it should work fine in the production environment.
Tester :
AdView mAdView = (AdView)rootView.findViewById(R.id.adView);
Builder adRequest = new AdRequest.Builder().addTestDevice("3F166F686479332267DD2DCCD89dfwrg");
AdRequest aaa=adRequest.build();
mAdView.loadAd(aaa);
Production:
AdView mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
You'll need to create a thread to load Ads.
new Thread(new Runnable() {
public void run() {
here your code to load banner ...
}
}).start();
For more documentation go to android developer's documentations on threads: http://developer.android.com/guide/components/processes-and-threads.html
If it returns error asking you to use main UiThread use following code in your Activity
runOnUiThread(new Runnable() {
public void run() {
interstitialAd.show();
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With