Not able to add Ads in player for android

FATAL EXCEPTION: pool-18-thread-3
Process: tv.willow, PID: 32138
java.lang.IllegalStateException: Android TV ads library should be called from an Android TV app
at com.google.android.gms.internal.atv_ads_framework.zzd.zzb(com.google.android.tv:tv-ads@@1.0.0-alpha01:27)
at com.google.android.tv.ads.zzg.run(com.google.android.tv:tv-ads@@1.0.0-alpha01:1)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)

Hi @kalyani.singh , thanks for reporting this error. Can you please share more context to help us understand the behaviour.

  • Which version of Bitmovin player SDK is used?

  • Is the behaviour reproducible using a Bitmovin sample application available at GitHub - bitmovin/bitmovin-player-android-samples: Sample apps for the Bitmovin Player Android SDK

  • Which Android device is the issue reproducible on?

  • What are the steps to repro the issue?

    • Does it happen while launching the app?
    • Is specific feature needed to be used to repro the issue?
    • What is the player configuration used?
  • In title, you mention Not able to add Ads. Can you please elaborate?

    • What type of Ads are you trying to use?
    • Can you pls share the Ad configuration used?
    • If these are client side Ads, have you tried following the build and player configuration shared in BasicAds sample application?

[quote=“Lucky Goyal, post:2, topic:1957, username:lucky.goyal”]
1)Which version of Bitmovin player SDK is used?
player version- com.bitmovin.player:player:3.36.0

2)Is the behaviour reproducible using a Bitmovin sample application

  • Its working fine in sample application
  1. Which Android device is the issue reproducible on?
  • Emulator as well as samsung mobile (galaxy M21 - SM-M215F/DS)

4)What are the steps to repro the issue?
yes i am following the same steps as sample app but it crashes on the launch itself we are using the android tv code also and having the same PLAYER_LICENSE_KEY and all for both android mobile and tv

  1. Can you pls share the Ad configuration used?
    AdvertisingConfig
    val firstAdSource = AdSource(AdSourceType.Ima, AD_SOURCE_1)
    val preRoll = AdItem(“pre”, firstAdSource)
    val advertisingConfig = AdvertisingConfig(preRoll)
    val playerConfig = PlayerConfig(advertisingConfig = advertisingConfig)

Note :- I am getting the error like (Failed to get advertising ID.)
FATAL EXCEPTION: pool-18-thread-3
Process: tv.willow, PID: 24204
java.lang.IllegalStateException: Android TV ads library should be called from an Android TV app
at com.google.android.gms.internal.atv_ads_framework.zzd.zzb(com.google.android.tv:tv-ads@@1.0.0-alpha01:27)

Thanks @kalyani.singh , is it possible to share a sample app where we can replicate this behaviour?

yes i am following the same steps as sample app but it crashes on the launch itself we are using the android tv code also and having the same PLAYER_LICENSE_KEY and all for both android mobile and tv

I did not fully understand the android tv part here. Can you please elaborate what is the android tv code and would this also be part of the app when running on Samsung device.

In general, the Android device should be supporting Google play services in order to allow Ad playback, so if you are testing this on a emulator or device without Google play services available, then the application will crash.

If you could provide a sample app where we can replicate the behaviour, then we can investigate further and find the root cause of issue. Please feel free to share the same via a DM or you can also open a support request through Bitmovin dashboard using your Bitmovin account and share the app details there. Please share the ticket id here for visibility if you do so.

Hi @lucky.goyal

The problem is with the version of player, its working fine for com.bitmovin.player:player:3.35.2
com.google.ads.interactivemedia.v3:interactivemedia:3.29.0
these version

but not working for these version and above versions
com.bitmovin.player:player:3.36.0
com.google.ads.interactivemedia.v3:interactivemedia:3.30.0

Hi @kalyani.singh , thanks for sharing this insight. The main change in player version 3.36.0 compared to 3.35.2 is update to Kotlin dependency to version 1.8.20.

The player SDK release notes can be checked at https://developer.bitmovin.com/playback/docs/release-notes-android#3360

Also IMA SDK(com.google.ads.interactivemedia.v3:interactivemedia) dependency is not raised to 3.30.0 in Bitmovin BasicAds sample app. Can you please retry with com.google.ads.interactivemedia.v3:interactivemedia:3.29.0?

Please also try with latest Bitmovin player 3.37.1 and com.google.ads.interactivemedia.v3:interactivemedia:3.29.0.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.