Error: You must have adactivity declared in androidmanifest.xml with configchanges

464 views
Skip to first unread message

Kevin Penhoat

unread,
Feb 10, 2014, 5:51:22 AM2/10/14
to google-adm...@googlegroups.com
First off, yes I've searched, I know this is a common error, but I've looked at all the solutions people give, they don't work. So maybe there is something else I'm overlooking.
I've tried this, but when I open up the app in the emulator, I get this error:
"You must have adactivity declared in androidmanifest.xml with configchanges" in the banner.

My main.xml File:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
     xmlns:app="http://schemas.android.com/apk/lib/com.google.ads">

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="200dp"
        android:layout_height="200dp"
        android:layout_centerHorizontal="true"
        android:src="@drawable/uccw_skins_icon" />
    
    <Button
        android:id="@+id/buttonRepairSkin"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/imageView1"
        android:layout_centerHorizontal="true"
        android:layout_gravity="center|center_vertical"
        android:layout_marginTop="8dp"
        android:gravity="center|center_horizontal"
        android:text="@string/install_skin" />

        <com.google.ads.AdView
            xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
            android:id="@+id/adView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/buttonRepairSkin"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="14dp"
            ads:loadAdOnCreate="true"
            ads:testDevices="TEST_EMULATOR"
            app:adSize="BANNER"
            app:adUnitId="ca-app-pub-7929055071587219/9030367286" >
        </com.google.ads.AdView>

</RelativeLayout>

My AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="penhoat.design.magux"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="8"
         android:targetSdkVersion="17" />
    

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
       <activity
            android:name="penhoat.design.magux.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
            <activity android:name="com.google.android.gms.ads.AdActivity"
             android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
    </application>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
      <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

</manifest>

 If someone knows the solution, please help, cause it's driving me crazy.

Amy Quispe (AdMob SDK Team)

unread,
Feb 17, 2014, 8:37:46 AM2/17/14
to google-adm...@googlegroups.com, kpen...@gmail.com
Hi Kevin,

It looks like you're using Google Play Services but are using the old namespaces. You can check out the migration guide here to make sure everything is consistent.

Hope this helps!

Amy Quispe
Reply all
Reply to author
Forward
0 new messages