我已添加了以下文件:
compile 'com.google.android.gms:play-services-ads:10.2.4'
在我的XML中:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.newtimebox.tictactoe.activities.MainActivity"
android:id="@+id/mainlayout"
android:background="@drawable/menu_back">
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-3940256099942544/6300978111">
</com.google.android.gms.ads.AdView></android.support.constraint.ConstraintLayout>
它说无法实例化一个或多个类 以下类无法实例化com.google.android.gms.ads.AdView(Open Class,Show Exception,Clear Cache)
我尝试了许多解决方案,例如Invalidate Cache,以及所有这些com.google.ads.AdView failed to instantiate
logcat的
07-06 17:07:00.802 13584-13598/? V/ViewRootImpl: Contents drawing finished : Application Error: com.newtimebox.tictactoe
07-06 17:07:00.862 24372-24409/? E/wget http://127.0.0.1:6880/callback.json: java.net.ConnectException: failed to connect to /127.0.0.1 (port 6880) after 30000ms: isConnected failed: ECONNREFUSED (Connection refused) (4ms)
07-06 17:07:00.862 24372-24409/? I/wget http://127.0.0.1:6880/callback.json: RETRY (15/200) in 100ms
07-06 17:07:00.999 24372-24409/? E/wget http://127.0.0.1:6880/callback.json: java.net.ConnectException: failed to connect to /127.0.0.1 (port 6880) after 30000ms: isConnected failed: ECONNREFUSED (Connection refused) (4ms)
07-06 17:07:01.000 24372-24409/? I/wget http://127.0.0.1:6880/callback.json: RETRY (16/200) in 100ms
为什么整个互联网都没有解决方案?