Daniel online
- Forum-Beiträge: 282
17.06.2011, 13:19:32 via Website
17.06.2011 13:19:32 via Website
Hey,
ich habe ein sehr komisches Problem mit Admob und bin hier schier am verzweifeln
Ich will ganz einfach unten an mein Layout an jede Seite in meiner App ein Ad anhängen.
Auf einer Seite klappt das auch, auf einer anderen aber komischerweise einfach nicht. Obwohl ich dort alles genauso machen!
Ich habe viel gegoogelt aber leider keine Lösung gefunden.
Dies ist ein Code wie ich die Ad einfüge, es klappt aber nicht.
Das wird im Graphical Layout der xml Datei angezeigt:
Das im Error Log:
main.xml: Parser is not a BridgeXmlBlockParser!
com.google.ads.AdView failed to instantiate.
AndroidManifest: Ignoring unknown 'enum' XML element
ich habe die attr.xml Datei wie folgt angelegt:
Im Manifest habe ich folgendes:
Ich hoffe ihr könnt mir helfen!
Danke schomal im Vorraus.
ich habe ein sehr komisches Problem mit Admob und bin hier schier am verzweifeln
Ich will ganz einfach unten an mein Layout an jede Seite in meiner App ein Ad anhängen.
Auf einer Seite klappt das auch, auf einer anderen aber komischerweise einfach nicht. Obwohl ich dort alles genauso machen!
Ich habe viel gegoogelt aber leider keine Lösung gefunden.
Dies ist ein Code wie ich die Ad einfüge, es klappt aber nicht.
1<?xml version="1.0" encoding="utf-8"?>
2<LinearLayout
3 xmlns:android="http://schemas.android.com/apk/res/android"
4 xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
5 android:orientation="vertical"
6 android:layout_width="fill_parent"
7 android:layout_height="fill_parent"
8 android:id="@+id/mainLayout"
9 android:background="@drawable/franz"
10 >
11 <LinearLayout
12 android:layout_width="match_parent"
13 android:layout_height="wrap_content"
14 >
15 <com.google.ads.AdView
16 android:id="@+id/adVie2w"
17 android:layout_width="wrap_content"
18 android:layout_height="wrap_content"
19 ads:adUnitId="a14df88b7f3b808"
20 ads:adSize="BANNER"
21 ads:loadAdOnCreate="true"
22
23 />
2<LinearLayout
3 xmlns:android="http://schemas.android.com/apk/res/android"
4 xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
5 android:orientation="vertical"
6 android:layout_width="fill_parent"
7 android:layout_height="fill_parent"
8 android:id="@+id/mainLayout"
9 android:background="@drawable/franz"
10 >
11 <LinearLayout
12 android:layout_width="match_parent"
13 android:layout_height="wrap_content"
14 >
15 <com.google.ads.AdView
16 android:id="@+id/adVie2w"
17 android:layout_width="wrap_content"
18 android:layout_height="wrap_content"
19 ads:adUnitId="a14df88b7f3b808"
20 ads:adSize="BANNER"
21 ads:loadAdOnCreate="true"
22
23 />
Das wird im Graphical Layout der xml Datei angezeigt:
1Parser is not a BridgeXmlBlockParser!
2The following classes could not be instantiated:
3- com.google.ads.AdView
4See the Error Log (Window > Show View) for more details.
2The following classes could not be instantiated:
3- com.google.ads.AdView
4See the Error Log (Window > Show View) for more details.
Das im Error Log:
main.xml: Parser is not a BridgeXmlBlockParser!
com.google.ads.AdView failed to instantiate.
AndroidManifest: Ignoring unknown 'enum' XML element
ich habe die attr.xml Datei wie folgt angelegt:
1<resources>
2<declare-styleable name="com.google.ads.AdView">
3 <attr name="adSize">
4 <enum name="BANNER" value="1"/>
5 <enum name="IAB_MRECT" value="2"/>
6 <enum name="IAB_BANNER" value="3"/>
7 <enum name="IAB_LEADERBOARD" value="4"/>
8 </attr>
9 <attr name="adUnitId" format="string"/>
10</declare-styleable>
11</resources>
2<declare-styleable name="com.google.ads.AdView">
3 <attr name="adSize">
4 <enum name="BANNER" value="1"/>
5 <enum name="IAB_MRECT" value="2"/>
6 <enum name="IAB_BANNER" value="3"/>
7 <enum name="IAB_LEADERBOARD" value="4"/>
8 </attr>
9 <attr name="adUnitId" format="string"/>
10</declare-styleable>
11</resources>
Im Manifest habe ich folgendes:
1<?xml version="1.0" encoding="utf-8"?>
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 package="de.Daniel.home"
4 android:versionCode="1"
5 android:versionName="1.0">
6
7
8 <application android:icon="@drawable/icon" android:label="@string/app_name">
9 <activity android:name=".kitchen_main"
10 android:label="@string/app_name">
11 <intent-filter>
12 <action android:name="android.intent.action.MAIN" />
13 <category android:name="android.intent.category.LAUNCHER" />
14 </intent-filter>
15 </activity>
16 <activity android:name=".setAlarm"></activity>
17 <activity android:name=".AlarmReceiver"></activity>
18 <activity android:name=".showAlertDialog" android:theme="@style/Theme.Transparent"></activity>
19
20 <receiver android:name=".widget1">
21 <intent-filter>
22 <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
23 <action android:name="com.android.myapp.widget.CLICK"></action>
24 </intent-filter>
25 <meta-data android:name="android.appwidget.provider" android:resource="@xml/widget1_prov" />
26 </receiver>
27 <service android:name=".miniService"/>
28 <activity android:name="com.google.ads.AdActivity"
29 android:configChanges="keyboard|keyboardHidden|orientation"/>
30 </application>
31
32 <uses-permission android:name="android.permission.INTERNET"/>
33 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
34 <uses-sdk android:minSdkVersion="4"></uses-sdk>
35</manifest>
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 package="de.Daniel.home"
4 android:versionCode="1"
5 android:versionName="1.0">
6
7
8 <application android:icon="@drawable/icon" android:label="@string/app_name">
9 <activity android:name=".kitchen_main"
10 android:label="@string/app_name">
11 <intent-filter>
12 <action android:name="android.intent.action.MAIN" />
13 <category android:name="android.intent.category.LAUNCHER" />
14 </intent-filter>
15 </activity>
16 <activity android:name=".setAlarm"></activity>
17 <activity android:name=".AlarmReceiver"></activity>
18 <activity android:name=".showAlertDialog" android:theme="@style/Theme.Transparent"></activity>
19
20 <receiver android:name=".widget1">
21 <intent-filter>
22 <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
23 <action android:name="com.android.myapp.widget.CLICK"></action>
24 </intent-filter>
25 <meta-data android:name="android.appwidget.provider" android:resource="@xml/widget1_prov" />
26 </receiver>
27 <service android:name=".miniService"/>
28 <activity android:name="com.google.ads.AdActivity"
29 android:configChanges="keyboard|keyboardHidden|orientation"/>
30 </application>
31
32 <uses-permission android:name="android.permission.INTERNET"/>
33 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
34 <uses-sdk android:minSdkVersion="4"></uses-sdk>
35</manifest>
Ich hoffe ihr könnt mir helfen!
Danke schomal im Vorraus.