我已经添加了grandle文件:
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 都无法实例化
日志猫
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
为什么在整个互联网上没有解决方案?