AdRequest in Banner collapsible : No virtual method addNetworkExtrasBundle

470 views
Skip to first unread message

Lương Thiện

unread,
Mar 26, 2024, 9:41:00 PM3/26/24
to Google Mobile Ads SDK Developers
How to display collapsible banner on version 23.0.0

Currently, I upgraded to version 23.0.0 and am having this error in the banner

java.lang.NoSuchMethodError: No virtual method addNetworkExtrasBundle(Ljava/lang/Class;Landroid/os/Bundle;)

implementation 'com.google.android.gms:play-services-ads:23.0.0'

Mobile Ads SDK Forum Advisor

unread,
Mar 27, 2024, 5:03:49 AM3/27/24
to luongphuc...@gmail.com, google-adm...@googlegroups.com

Hi,

I have executed our Google Sample project in version 23.0.0 and am able to load the collapsible banner ad without any error. 

To display the collapsible banner ad, the following code can be used in the Banner sample application

val extras = Bundle()

  extras.putString("collapsible", "bottom")

  val adRequest = AdRequest.Builder()

    .addNetworkExtrasBundle(AdMobAdapter::class.java, extras)

    .build()

  adView.loadAd(adRequest) 

For further information, kindly refer to the Collapsible banner documentation.

If the issue still persists, kindly provide us with the below information for further investigation: 

  • The full stack trace
  • Sample project reproducing the issue

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, kindly provide requested information to us via reply to author option or using the steps below:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002s0GckQAE&entry.80707362=00228834

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

This message is in relation to case "ref:!00D1U01174p.!5004Q02s0Gck:ref" (ADR-00228834)

Thanks,
 
Google Logo Mobile Ads SDK Team


Reply all
Reply to author
Forward
0 new messages