我快疯了。
我想使用Google Play服务更改AdMob,但卡在这个错误上了。
Caused by: android.view.InflateException: Binary XML file line #53: Error inflating class com.google.android.gms.ads.AdView
我有这个:
<com.google.android.gms.ads.AdView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:id="@+id/adViewPers"/>
同时,还有这个:
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
主活动
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdSize;
import com.google.android.gms.ads.AdView;
...
private AdView adViewPers;
...
adViewPers = (AdView) findViewById(R.id.adViewPers);
adViewPers.setAdUnitId("xxxxxxx");
adViewPers.setAdSize(AdSize.SMART_BANNER);
AdRequest adRequest = new AdRequest.Builder().build();
adViewPers.loadAd(adRequest);
在依赖项中:
我做错了什么???