1
私は奇妙な問題に直面しています。上記の行でAdRequestが解決せず、REDでマークされていますが、アプリは正常に動作します
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
クラスAdRequest
とREDマークAdView
とIDEは伝え:Cannot resolve symbol!
をしかし、私は自分のデバイス上でアプリケーションを実行すると、すべてのものはOKを実行します。コンパイラエラーがなく、デバイスに広告が表示されます。
以下は私の依存関係です。
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('src/main/java/nineoldandroid.jar')
compile files('android.jar')
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-messaging:9.4.0'
compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.android.support:support-v4:24.2.0'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile files('httpclient-4.5.2.jar')
compile files('httpcore-4.4.4.jar')
compile 'com.google.android.gms:play-services-appindexing:9.4.0'
}
apply plugin: 'com.google.gms.google-services'
とXMLファイル
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-*******"
android:layout_above="@+id/adView2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:paddingBottom="5dp"
android:background="#000000" />