そのため、admob を使用してアプリに簡単な広告を追加しようとしています。SDK を使用してチュートリアルに従いましたが、1 つのエラーで行き詰まりました。
エラーは次のとおりです。
Multiple annotations found at this line:
- ERROR No resource identifier found for attribute 'secondaryTextColor' in package
'man.utd.headlines.man.utd'
- ERROR No resource identifier found for attribute 'primaryTextColor' in package 'man.utd.headlines.man.utd'
- ERROR No resource identifier found for attribute 'backgroundColor' in package 'man.utd.headlines.man.utd'
パッケージ名に問題があるに違いないと思いますが、私が見る限り、すべて問題ありません。
私のレイアウトファイルには次のものがあります:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/man.utd.headlines.man.utd"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
しかし、パッケージ名は正しいようです:
package man.utd.headlines.man.utd;
何か案は?とてもイライラします!
マニフェストも確認し、このパッケージ名で試しましたが、まだ機能しません:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="man.utd.headlines"
どんな助けでも大歓迎です。
更新:パッケージ名を変更してより一貫性を持たせることで解決しました-メインクラスとマニフェストでまったく同じである必要があります!
新しい問題: 広告が表示されない!
Heres私のレイアウトファイル:
<?xml version="1.0" encoding="utf-8"?>
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="100px"
myapp:backgroundColor="#000000"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC" />
何か案は?どんな助けでも大歓迎です:)。