Note that there are some explanatory texts on larger screens.

plurals
  1. POAdmob publish id error
    primarykey
    data
    text
    <p>I have created a paid application and I'm trying to create the free with admob ads. I setup the entire proyect as explained on Google's tutorial with SDK 6.1, but when running it doesn't work.</p> <p>The code I have used is the same as the tutorial: Main.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello"/&gt; &lt;com.google.ads.AdView android:id="@+id/ad" android:layout_width="wrap_content" android:layout_height="wrap_content" ads:adSize="BANNER" ads:adUnitId="xxxxxxxxxx" ads:loadAdOnCreate="true"/&gt; &lt;/LinearLayout&gt; </code></pre> <p>BannerSample.java package com.google.example.ads.xml;</p> <pre><code>import android.app.Activity; import android.os.Bundle; /** * A simple {@link Activity} which embeds an AdView in its layout XML. */ public class BannerSample extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // This example requires no additional code since the optional // "loadAdOnCreate=true" XML attribute was used. If "loadAdOnCreate" were // not specified, the ad would have to be loaded by creating an AdRequest // and using Activity.findViewById() to get the AdView. // // The "loadAdOnCreate" XML attribute makes it simpler to get ads since no // code is required, but it also limits the developer's control over the ad // request since a generic AdRequest is used. } } </code></pre> <p>The errors I get:</p> <pre><code>07-28 21:34:48.704: E/Ads(15980): JS: Uncaught ReferenceError: AFMA_getSdkConstants is not defined (about:blank:1) 07-28 21:34:48.704: E/Web Console(15980): Uncaught ReferenceError: AFMA_getSdkConstants is not defined at about:blank:1 07-28 21:36:48.841: E/Ads(15980): JS: Uncaught ReferenceError: AFMA_getSdkConstants is not defined (about:blank:1) 07-28 21:36:48.841: E/Web Console(15980): Uncaught ReferenceError: AFMA_getSdkConstants is not defined at about:blank:1 07-28 21:38:48.958: E/Ads(15980): JS: Uncaught ReferenceError: AFMA_getSdkConstants is not defined (about:blank:1) 07-28 21:38:48.958: E/Web Console(15980): Uncaught ReferenceError: AFMA_getSdkConstants is not defined at about:blank:1 07-28 21:40:49.066: E/Ads(15980): JS: Uncaught ReferenceError: AFMA_getSdkConstants is not defined (about:blank:1) 07-28 21:40:49.066: E/Web Console(15980): Uncaught ReferenceError: AFMA_getSdkConstants is not defined at about:blank:1 07-28 21:42:02.817: E/chromium(17098): external/chromium/net/disk_cache/stat_hub.cc:190: [0728/214202:ERROR:stat_hub.cc(190)] StatHub::Init - App com.google.example.ads.xml isn't supported. 07-28 21:42:02.827: E/chromium(17098): external/chromium/net/disk_cache/stat_hub.cc:190: [0728/214202:ERROR:stat_hub.cc(190)] StatHub::Init - App com.google.example.ads.xml isn't supported. 07-28 21:42:03.178: E/Ads(17098): JS: Uncaught ReferenceError: AFMA_getSdkConstants is not defined (about:blank:1) 07-28 21:42:03.198: E/Web Console(17098): Uncaught ReferenceError: AFMA_getSdkConstants is not defined at about:blank:1 </code></pre> <p>Thanks for the help!</p> <p><strong>UPDATE:</strong> New code and erros are: BannerSample.java</p> <pre><code>package com.google.example.ads.xml; import com.google.ads.AdRequest; import com.google.ads.AdView; import android.app.Activity; import android.os.Bundle; import android.os.Looper; /** * A simple {@link Activity} which embeds an AdView in its layout XML. */ public class BannerSample extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // This example requires no additional code since the optional // "loadAdOnCreate=true" XML attribute was used. If "loadAdOnCreate" were // not specified, the ad would have to be loaded by creating an AdRequest // and using Activity.findViewById() to get the AdView. // // The "loadAdOnCreate" XML attribute makes it simpler to get ads since no // code is required, but it also limits the developer's control over the ad // request since a generic AdRequest is used. (new Thread() { public void run() { Looper.prepare(); AdView view = (AdView) findViewById(R.id.ad); view.loadAd(new AdRequest()); } }).start(); } } </code></pre> <p>Errors:</p> <pre><code>07-28 21:42:02.817: E/chromium(17098): external/chromium/net/disk_cache/stat_hub.cc:190: [0728/214202:ERROR:stat_hub.cc(190)] StatHub::Init - App com.google.example.ads.xml isn't supported. 07-28 21:42:02.827: E/chromium(17098): external/chromium/net/disk_cache/stat_hub.cc:190: [0728/214202:ERROR:stat_hub.cc(190)] StatHub::Init - App com.google.example.ads.xml isn't supported. </code></pre> <p><strong>UPDATE 2:</strong> Sorry I forget to post the manifest:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.example.ads.xml" android:versionCode="1" android:versionName="1.0"&gt; &lt;uses-sdk android:targetSdkVersion="15" android:minSdkVersion="3"/&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt; &lt;uses-permission android:name="android.permission.INTERNET"/&gt; &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;meta-data android:value=" a1501435dfa5050 " android:name="ADMOB_PUBLISHER_ID" /&gt; &lt;activity android:name=".BannerSample" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload