googleads / googleads-mobile-android-examples

googleads-mobile-android
Apache License 2.0
1.72k stars 1.87k forks source link

Updating to SDK 30 stops the ads from showing up #265

Open DonovanPhoenix opened 4 years ago

DonovanPhoenix commented 4 years ago

I was getting an I/Ads: Ad failed to load : 0 error from Logcat. Eventually, I downloaded the /kotlin/admob/BannerExample/ then started updating it to match my project. I found when I changed compileSdkVersion 30 and targetSdkVersion 30 the ad stops working, I'm now using SDK 29, not sure if this is a feature...

stowy commented 4 years ago

Hi, I tried to reproduce this but was unable to. Can you please provide more specific repro steps? What device did you run it on, API version, etc? Were you using play-services-ads:19.3.0?

DonovanPhoenix commented 4 years ago

here is the Virtual device settings 👍

Name: Pixel_3a_API_30
CPU/ABI: Google Play Intel Atom (x86)
Path: C:\Users\Phoenix\.android\avd\Pixel_3a_API_30.avd
Target: google_apis_playstore [Google Play] (API level 30)
Skin: pixel_3a
SD Card: 512M
fastboot.chosenSnapshotFile: 
runtime.network.speed: full
hw.accelerometer: yes
hw.device.name: pixel_3a
hw.lcd.width: 1080
hw.initialOrientation: Portrait
image.androidVersion.api: 30
tag.id: google_apis_playstore
hw.mainKeys: no
hw.camera.front: emulated
avd.ini.displayname: Pixel 3a API 30
hw.gpu.mode: auto
hw.ramSize: 1536
PlayStore.enabled: true
fastboot.forceColdBoot: no
hw.cpu.ncore: 4
hw.keyboard: yes
hw.sensors.proximity: yes
hw.dPad: no
hw.lcd.height: 2220
vm.heapSize: 256
skin.dynamic: yes
hw.device.manufacturer: Google
hw.gps: yes
hw.audioInput: yes
image.sysdir.1: system-images\android-30\google_apis_playstore\x86\
showDeviceFrame: yes
hw.camera.back: virtualscene
AvdId: Pixel_3a_API_30
hw.lcd.density: 440
hw.arc: false
hw.device.hash2: MD5:0e6953ebf01bdc6b33a2f54746629c50
fastboot.forceChosenSnapshotBoot: no
fastboot.forceFastBoot: yes
hw.trackBall: no
hw.battery: yes
hw.sdCard: yes
tag.display: Google Play
runtime.network.latency: none
disk.dataPartition.size: 6442450944
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes

Attached is the modified banner example (Kotlin) go to build.graidle and change compileSdkVersion& targetSdkVersion to 29 to get it to work

BannerExample.zip

Sonu0985 commented 4 years ago

Hi , This issue is happening on Java project also. If the app is compiled with below config :

            compileSdkVersion 30
              buildToolsVersion '30.0.1'
              targetSdkVersion 30

and installed on Android 11 device , the ad fails to load. Below are the captured errors:

com.google.android.gms.example.bannerexample I/Ads: Ad Failed to load message :Internal error. com.google.android.gms.example.bannerexample I/Ads: Ad Failed to load cause :null com.google.android.gms.example.bannerexample I/Ads: Ad Failed to load domain :com.google.android.gms.ads com.google.android.gms.example.bannerexample I/Ads: Ad failed to load : 0

Note : The same API 30 compiled app works fine with Android 10 devices.

Logged Issue with Android also : https://issuetracker.google.com/issues/163432178

Schwankenson commented 2 years ago

Any idea for a workaround? I`m using capacitor admob plugin, and am not able to compile it for Android 11 and 12. Only one version is working. Is Google really going to fix this? Or do we have to think about fixing it with a workaround?