Call to playAd without appropriate call to loadAd first

277 views
Skip to first unread message

Nam Tran

unread,
Nov 23, 2021, 8:33:47 PM11/23/21
to Interactive Media Ads SDK
Hi Team Support,

I'm developer Android. I working on Ad IMA and got an issue
Call to playAd without appropriate call to loadAd first
Log: 
Fatal Exception: java.lang.IllegalStateException: Call to playAd without appropriate call to loadAd first.
      at com.google.ads.interactivemedia.v3.internal.fr.playAd(fr.java:124)
      at com.google.ads.interactivemedia.v3.internal.et.d(et.java:37)
      at com.google.ads.interactivemedia.v3.internal.em.s(em.java:83)
      at com.google.ads.interactivemedia.v3.internal.em.e(em.java:154)
      at com.google.ads.interactivemedia.v3.internal.es.d(es.java:57)
      at com.google.ads.interactivemedia.v3.internal.ep.shouldOverrideUrlLoading(ep.java:12)
      at android.webkit.WebViewClient.shouldOverrideUrlLoading(WebViewClient.java:83)
      at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:14)
      at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
      at android.os.MessageQueue.next(MessageQueue.java:335)
      at android.os.Looper.loop(Looper.java:183)
      at android.app.ActivityThread.main(ActivityThread.java:7722)
      at java.lang.reflect.Method.invoke(Method.java)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:627)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)

- We can not reproduce in my side. it just occur after release app  on Store. 
So, I don't step to reproduce this issue.
- For sample app(Android) -> can not reproduce.
Currently, I using:
SDK: com.google.ads.interactivemedia.v3:interactivemedia:3.22.3

Could you please help me check the issue. If you need more information. Please let me know.

Thank you,
Nam

IMA SDK

unread,
Nov 24, 2021, 1:35:12 AM11/24/21
to nam....@codecomplete.jp, ima...@googlegroups.com

Hi Nam,

 

Thank you for reaching out to us.

 

Best way to solve the issue is through replication of the behavior. However, you mentioned that there is no known way to replicate the said issue. So, let me just share my thoughts based on the details you have currently shared. It seems like the issue here is you are trying to play the ad without loading the ads or requesting for the ads to be played. You may want to check our SDK Architecture for better understanding on the lifecycle of the SDK.

 

Additionally, it would also be best to check out Get Started guide and our Android sample apps and use them as reference for your own application to avoid implementation issues.

 

Lastly, I also noticed that you are still using an older version of the Android SDK. We would recommend to update to the latest version (v3.25.1) to be updated on the latest features and possibly avoid other issues that have been fixed with the latest updates.

Regards,

Google Logo
Michael Angelo Legaspi
IMA SDK Team
 


ref:_00D1U1174p._5004Q2RvoOW:ref

Nam Tran

unread,
Dec 30, 2021, 2:37:49 AM12/30/21
to IMA SDK, ima...@googlegroups.com
Hi support team,

I tried update to latest version (3.25.1) but issue still happen.
In the my code : we have override the function loadAd and playAd
But when I debug log in the function loadAd I don’t see any log from this function.
I don’t find any where call the loadAd function. I think it came from other way (SDK or some thing like that)
For the playAd function called when I click on the resume button in my app.

Could you please help me investigate this issue.

override fun loadAd(adMediaInfo: AdMediaInfo, adPodInfo: AdPodInfo) {
Log.i(DEBUG_IMA","loadAd")
this.adMediaInfo = adMediaInfo
if (adMediaInfo != null && adMediaInfo.url != null && adMediaInfo.url.length > 0) {
url = adMediaInfo.url
baseVideoView.setVideoPath(url)
}
}

override fun playAd(adMediaInfo: AdMediaInfo?) {
Log.i(DEBUG_IMA","playAd")
this.adMediaInfo = adMediaInfo
adsManager?.resume()
didPlay()
}

Thank you so much,
Nam

IMA SDK

unread,
Dec 31, 2021, 2:07:20 AM12/31/21
to nam....@codecomplete.jp, ima...@googlegroups.com

Hello Nam,

 

Thank you for responding back to us.

 

Kindly check our documentation for AdsManager interface, this is the object which handles playing ads after they've been received from the server. After the AdsManager is retrieved from an AdsManagerLoadedEventinit should be called first. After the LOADED event is fired, start can be called. At any time, destroy can be called to end ad playback.

 

Additionally, we cannot debug base on your code snippet only. What we can recommend to you is to check our sample apps and use that as reference for your own integration of the SDK to avoid implementation issues. Should you still encounter any issue after doing so, kindly share with us your sample project implementation that can replicate the issue so we can further investigate and the steps to reproduce the behavior.

Regards,

Reply all
Reply to author
Forward
0 new messages