Trying to test Mediation with Mediation Test Suite

779 views
Skip to first unread message

arnav....@momagic.com

unread,
Sep 29, 2018, 7:40:26 AM9/29/18
to Google Mobile Ads SDK Developers

But unable to run project.

Getting following error while trying to run project-

java.lang.NoSuchFieldError: No static field pager of type I in class Lcom/google/android/ads/mediationtestsuite/R$id; or its superclasses (declaration of 'com.google.android.ads.mediationtestsuite.R$id' appears in /data/app/com.abcd.efgh-eAItCByK7zIPmbyh7fENOQ==/base.apk!classes2.dex)
        at com.google.android.ads.mediationtestsuite.activities.HomeActivity.setViewPager(HomeActivity.java:91)
        at com.google.android.ads.mediationtestsuite.activities.HomeActivity.onCreate(HomeActivity.java:60)
        at android.app.Activity.performCreate(Activity.java:7009)
        at android.app.Activity.performCreate(Activity.java:7000)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)


App has Kotlin support.

multidex is enabled.

Running only debug build and  proguard is NOT enabled.

Please help.

mobileadssdk-a...@google.com

unread,
Oct 1, 2018, 6:45:15 AM10/1/18
to arnav....@momagic.com, Google Mobile Ads SDK Developers
Hi,

Thank you for reaching out to us regarding this.

Please note that both Kotlin and Java are supported when using any of the Mobile Ads SDK features like mediation in your Android app. Thus, the Mediation Test Suite should also work. 

That said, the NoSuchFieldError encountered seem to be triggered when setting the ViewPager in the Mediation Test Suite. Thus, I created this sample app for Kotlin which is basically just an empty app (with multidex enabled) that launches the Mediation Test Suite tool in onCreate(). Upon testing, I didn't encounter the crash you've captured and I was able to launch the Mediation Test Suite successfully.

Could you test the sample app on your end and see if you can reproduce the same error? On the other hand, could you provide to us the project you are working on that can reproduce the NoSuchFieldError so that we can have a closer look on our end? You may share to us the project privately using Reply privately to author option.

Regards,
Ivan Bautista
Mobile Ads SDK Team




--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/5e459b37-4f96-4742-8e81-b60f646d918c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

arnav....@momagic.com

unread,
Oct 1, 2018, 8:27:39 AM10/1/18
to Google Mobile Ads SDK Developers
Thanks for your reply.

The sample you provided is working perfectly fine.

The issue i found in my build was- the field "R.id.pager" is not present in generated APK in classes2.dex and it crashes at runtime. 
But it is present in classes3.dex .

I don't know why the system not looking into classes3.dex ??

mobileadssdk-a...@google.com

unread,
Oct 2, 2018, 2:40:20 AM10/2/18
to arnav....@momagic.com, Google Mobile Ads SDK Developers
Hi,

Thank you for testing the sample project.

Could you provide to us a copy of the project where you can reproduce the issue so we can further investigate on our end? You may share to us the project privately using Reply privately to author option.

Regards,
Ivan Bautista
Mobile Ads SDK Team



To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

mobileadssdk-a...@google.com

unread,
Oct 3, 2018, 7:48:30 AM10/3/18
to arnav....@momagic.com, Google Mobile Ads SDK Developers
Hi,

Thank you for providing to us a copy of your project privately. 

I was able to reproduce the error logs when I ran your project. That said, I will raise this to the rest of the team and get back to you for any feedback.

Regards,
Ivan Bautista
Mobile Ads SDK Team


CityBus

unread,
Oct 27, 2018, 9:42:45 AM10/27/18
to Google Mobile Ads SDK Developers
I get similar error      
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.view.ViewPager.setAdapter(android.support.v4.view.PagerAdapter)' on a null object reference
        at com.google.android.ads.mediationtestsuite.activities.HomeActivity.setViewPager(HomeActivity.java:94)
        at com.google.android.ads.mediationtestsuite.activities.HomeActivity.onCreate(HomeActivity.java:60)
        at android.app.Activity.performCreate(Activity.java:5933)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) 
        at android.app.ActivityThread.access$800(ActivityThread.java:144) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:135) 
        at android.app.ActivityThread.main(ActivityThread.java:5221) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) 

In my app I use 3 AdMob banners - 2 with mediation and 1 w/o. Could it cause those problems? Tried 0.9.1 and 0.9.2 versions - both of them affected...

mobileadssdk-a...@google.com

unread,
Oct 29, 2018, 4:03:19 AM10/29/18
to arnav....@momagic.com, Google Mobile Ads SDK Developers
Hi Arnav,

Upon checking the project you provided privately, we've pointed out that the root cause of the NoSuchFieldError encountered on your end is because of a naming collision between resources of your test project and the Mediation Test Suite particularly your content_main.xml file. 

To fix this on your end, you can try to prefix all your resources accordingly.

Regards,
Ivan Bautista
Mobile Ads SDK Team



mobileadssdk-a...@google.com

unread,
Oct 29, 2018, 4:04:27 AM10/29/18
to CityBus, Google Mobile Ads SDK Developers
Hi there,

Please note that the NullPointerException you encountered seems to be different to the NoSuchFieldError encountered by Arnav which we can reproduce consistently by adding an XML layout named content_main.

Since we can't reproduce the NullPointerException you encountered when launching the Mediation Test Suite, could you provide to us a copy of a test project where we can reproduce the exception so we can have a closer look on this? Given that this is a different issue, could you create a new thread then share to us the test project privately using Reply privately to author option?

Regards,
Ivan Bautista
Mobile Ads SDK Team


--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

arnav....@momagic.com

unread,
Oct 29, 2018, 5:24:59 AM10/29/18
to Google Mobile Ads SDK Developers
Hi,
Thanks for finding out that bug. For now i will try with that change but i suggest that the library should change the default resource name as it will be a common error if someone try to test with default project generated via AndroidStudio that contains "content_main.xml".

mobileadssdk-a...@google.com

unread,
Oct 30, 2018, 12:41:54 AM10/30/18
to arnav....@momagic.com, Google Mobile Ads SDK Developers
Hi Arnav,

Yes, the team is working on this. However, we don't have any definite timelines on this or which version it will be included in the future. That said, I'll keep you posted for any updates.

Regards,
Ivan Bautista
Mobile Ads SDK Team



To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

sdz...@gmail.com

unread,
Oct 8, 2020, 10:13:11 AM10/8/20
to Google Mobile Ads SDK Developers
Hi Guys, I have an app which is already live and Admob ads are working fine.. This is just to prove app id has been added properly in manifest file.. Recently i have implemented mediation. To test mediation i added test suite v1.4.0 in gradle. then started test suite using MediationTestSuite.launch(this).. I tried calling this immediately in onCreate and also tried launching test suite after initializing of MobileAds.. I also tried passing app ID in launch function as 2nd arg..
No matter how many ways i try, I'm getting the following crash.. Please help me with this or if the issue is with test suite, please solve it ASAP.

java.lang.AssertionError: AssertionError (GSON 2.8.6): java.lang.NoSuchFieldException: ERROR
        at e.d.d.f.h(:949)
        at e.d.d.f.i(:897)
        at e.d.d.f.j(:846)
        at e.d.b.a.a.k.h.f(:215)
        at e.d.b.a.a.k.f.q(:71)
        at com.google.android.ads.mediationtestsuite.activities.HomeActivity.onCreate(:50)
        at android.app.Activity.performCreate(Activity.java:7826)
        at android.app.Activity.performCreate(Activity.java:7815)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1318)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3355)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3519)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2126)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:219)
        at android.app.ActivityThread.main(ActivityThread.java:7709)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
     Caused by: java.lang.AssertionError: java.lang.NoSuchFieldException: ERROR
        at com.google.gson.internal.bind.TypeAdapters$c0.<init>(:792)
        at com.google.gson.internal.bind.TypeAdapters$30.b(:818)
        at e.d.d.f.k(:458)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(:117)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.e(:166)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.b(:102)
        at e.d.d.f.k(:458)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(:117)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.e(:166)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.b(:102)
        at e.d.d.f.k(:458)
        at com.google.gson.internal.bind.CollectionTypeAdapterFactory.b(:53)
        at e.d.d.f.k(:458)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(:117)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.e(:166)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.b(:102)
        at e.d.d.f.k(:458)
        at com.google.gson.internal.bind.CollectionTypeAdapterFactory.b(:53)
        at e.d.d.f.k(:458)
        at e.d.d.f.h(:931)
        at e.d.d.f.i(:897) 
        at e.d.d.f.j(:846) 
        at e.d.b.a.a.k.h.f(:215) 
        at e.d.b.a.a.k.f.q(:71) 
        at com.google.android.ads.mediationtestsuite.activities.HomeActivity.onCreate(:50) 
        at android.app.Activity.performCreate(Activity.java:7826) 
        at android.app.Activity.performCreate(Activity.java:7815) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1318) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3355) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3519) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2126) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:219) 
        at android.app.ActivityThread.main(ActivityThread.java:7709) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 
     Caused by: java.lang.NoSuchFieldException: ERROR
        at java.lang.Class.getField(Class.java:1604)
        at com.google.gson.internal.bind.TypeAdapters$c0.<init>(:781)
        at com.google.gson.internal.bind.TypeAdapters$30.b(:818) 
        at e.d.d.f.k(:458) 
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(:117) 
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.e(:166) 
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.b(:102) 
        at e.d.d.f.k(:458) 
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(:117) 
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.e(:166) 
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.b(:102) 
        at e.d.d.f.k(:458) 
        at com.google.gson.internal.bind.CollectionTypeAdapterFactory.b(:53) 
        at e.d.d.f.k(:458) 
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(:117) 
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.e(:166) 
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.b(:102) 
        at e.d.d.f.k(:458) 
        at com.google.gson.internal.bind.CollectionTypeAdapterFactory.b(:53) 
        at e.d.d.f.k(:458) 
        at e.d.d.f.h(:931) 
        at e.d.d.f.i(:897) 
        at e.d.d.f.j(:846) 
        at e.d.b.a.a.k.h.f(:215) 
        at e.d.b.a.a.k.f.q(:71) 
        at com.google.android.ads.mediationtestsuite.activities.HomeActivity.onCreate(:50) 
        at android.app.Activity.performCreate(Activity.java:7826) 
        at android.app.Activity.performCreate(Activity.java:7815) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1318) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3355) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3519) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2126) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:219) 
        at android.app.ActivityThread.main(ActivityThread.java:7709) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 


To post to this group, send email to google-adm...@googlegroups.com.

Mobile Ads SDK Forum Advisor Prod

unread,
Oct 8, 2020, 12:39:35 PM10/8/20
to sdz...@gmail.com, google-adm...@googlegroups.com
Hi Techie,

Thank you for bringing this issue to our attention. I was able to find this article on Github that talks very much about this issue. While the original pst is older. I would suggest to go more down on the page and you will see more recent references to this. Also they offer some reasons and solutions that people have said work.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 

 

ref:_00D1U1174p._5004Q267lFm:ref
Reply all
Reply to author
Forward
0 new messages