Java 尝试添加“时出错”;AdMob";
这是我第一次使用admob。下面是一个完整的文件和XML文件 Tic Tac Toe.xmlJava 尝试添加“时出错”;AdMob";,java,android,eclipse,admob,Java,Android,Eclipse,Admob,这是我第一次使用admob。下面是一个完整的文件和XML文件 Tic Tac Toe.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_p
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TableLayout
android:id="@+id/tableLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:stretchColumns="*" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="" />
<Button
android:id="@+id/button5"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="" />
<Button
android:id="@+id/button6"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="" />
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button7"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="" />
<Button
android:id="@+id/button8"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="" />
<Button
android:id="@+id/button9"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="" />
</TableRow>
</TableLayout>
<com.google.ads.AdView
xmlns:googleads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
googleads:adSize="BANNER"
android:layout_alignParentBottom="true"
googleads:adUnitId="a1525bbc8227f4a " />
</RelativeLayout>
为什么我会得到这个 在相对布局中添加此链接 编辑
同时更改您的舱单
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
您需要如下声明您的
适应性(这是您的logcat中要求的):
谢谢您的回复。您的意思是删除“xmlns:android=”“”并添加新的?非常感谢您的回复+谢谢你的回复。它删除了错误,但现在它是空的!您的adUnitId=“a1525bbc8227f4a”
末尾有空格,这可能不正确。我删除了该空格。但还是不行。我还没有在市场上“发布”这篇文章,这就是问题所在吗?而且我在java文件中也没有引用add的“代码”
10-14 15:58:57.500: E/Ads(633): The android:configChanges value of the com.google.ads.AdActivity must include screenLayout.
10-14 15:58:57.500: E/Ads(633): The android:configChanges value of the com.google.ads.AdActivity must include uiMode.
10-14 15:58:57.510: E/Ads(633): The android:configChanges value of the com.google.ads.AdActivity must include screenSize.
10-14 15:58:57.510: E/Ads(633): The android:configChanges value of the com.google.ads.AdActivity must include smallestScreenSize.
10-14 15:58:57.510: E/Ads(633): You must have AdActivity declared in AndroidManifest.xml with configChanges.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>