我将广告从15.0.1升级到17.0.0
所以我在AndroidManifest.xml中添加了<meta-data android:name="com.google.android.gms.ads.AD_MANAGER_APP" android:value="true"/>
。
我可以同时删除当前AndroidManifest.xml中的<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"/>
当前的AndroidManifest.xml
<meta-data android:name="com.google.android.gms.ads.AD_MANAGER_APP" android:value="true"/>
<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"/>
当前build.gradle
implementation 'com.google.android.gms:play-services-ads:17.0.0'
以前的AndroidManifest.xml
<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"/>
先前的build.gradle
implementation 'com.google.android.gms:play-services-ads:15.0.1'