AdView : JS: Uncaught ReferenceError: AFMA_getSdkConstants is not defined (http://media.admob.com/:1)-Collection of common programming errors

I have such layout as :


     
      
           
         

            

 

THis is how I download ad :

if (isOnline())
    {
        adView.loadAd(new AdRequest());
    }
    else
    {
        adView.setVisibility(View.GONE);
    }

isOnLine method checks the internet connection :

public boolean isOnline() {
   boolean res = false;
    ConnectivityManager cm = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo netInfo = cm.getActiveNetworkInfo();
    if (netInfo != null && netInfo.isConnectedOrConnecting()) {
       res= true;
    }
    else
    {
       res = false;
     }
    return res;
}

I tried to get help from this answer and download ad in another thread, but it doesn’t help me.

When I open my activity with the ad it do not opens sometimes and I get next exceptions:

    10-01 12:24:43.423: E/Ads(26065): JS: Uncaught ReferenceError: AFMA_getSdkConstants is not defined (http://media.admob.com/:1)
10-01 12:24:43.423: E/Web Console(26065): Uncaught ReferenceError: AFMA_getSdkConstants is not defined at http://media.admob.com/:1