Error while integrating MoPub SDK in app for mediation via Admob

118 views
Skip to first unread message

Dr. Shrinidhi Manikarnike

unread,
Nov 17, 2019, 11:40:50 AM11/17/19
to Google Mobile Ads SDK Developers
I am trying to integrate MoPub SDK in my Android app Chakra Activator Lite. I am using Admob as primary SDK and trying to mediate MoPub through Admob.

I get the following error in the app when I switch from one activity to another

in.holistichealer.chakraactivatorlite E/ActivityThread: Activity in.holistichealer.chakraactivatorlite.SacralChakra has leaked IntentReceiver com.mopub.mobileads.MoPubView$1@bce1cef that was originally registered here. Are you missing a call to unregisterReceiver()?
    android.app.IntentReceiverLeaked: Activity in.holistichealer.chakraactivatorlite.SacralChakra has leaked IntentReceiver com.mopub.mobileads.MoPubView$1@bce1cef that was originally registered here. Are you missing a call to unregisterReceiver()?
        at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:1172)
        at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:955)
        at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1340)
        at android.app.ContextImpl.registerReceiver(ContextImpl.java:1320)
        at android.app.ContextImpl.registerReceiver(ContextImpl.java:1314)
        at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:596)
        at com.mopub.mobileads.MoPubView.registerScreenStateBroadcastReceiver(MoPubView.java:193)
        at com.mopub.mobileads.MoPubView.<init>(MoPubView.java:155)
        at com.mopub.mobileads.MoPubView.<init>(MoPubView.java:137)
        at com.mopub.mobileads.MoPubInterstitial$MoPubInterstitialView.<init>(MoPubInterstitial.java:501)
        at com.mopub.mobileads.MoPubInterstitial.<init>(MoPubInterstitial.java:94)
        at com.mopub.mobileads.dfp.adapters.MoPubAdapter.requestInterstitialAd(MoPubAdapter.java:548)
        at com.google.android.gms.internal.ads.zzaly.zza(com.google.android.gms:play-services-ads-lite@@18.3.0:81)
        at com.google.android.gms.internal.ads.zzalg.zza(com.google.android.gms:play-services-ads-lite@@18.3.0:71)
        at com.google.android.gms.internal.ads.zzgb.onTransact(com.google.android.gms:play-services-ads-base@@18.3.0:13)
        at android.os.Binder.transact(Binder.java:499)
        at fe.b(:com.google.android.gms.policy_ads_fdr_dynamite@21001004@21001004.272763194.272763194:2)
        at com.google.android.gms.ads.internal.mediation.client.e.a(:com.google.android.gms.policy_ads_fdr_dynamite@21001004@21001004.272763194.272763194:6)
        at com.google.android.gms.ads.nonagon.render.au.a(:com.google.android.gms.policy_ads_fdr_dynamite@21001004@21001004.272763194.272763194:12)
        at com.google.android.gms.ads.nonagon.render.dc.a(:com.google.android.gms.policy_ads_fdr_dynamite@21001004@21001004.272763194.272763194)
        at com.google.android.gms.ads.nonagon.util.concurrent.o.call(:com.google.android.gms.policy_ads_fdr_dynamite@21001004@21001004.272763194.272763194)
        at wp.a(:com.google.android.gms.policy_ads_fdr_dynamite@21001004@21001004.272763194.272763194:1)
        at wa.run(:com.google.android.gms.policy_ads_fdr_dynamite@21001004@21001004.272763194.272763194:7)
        at wq.run(:com.google.android.gms.policy_ads_fdr_dynamite@21001004@21001004.272763194.272763194:1)
        at android.os.Handler.handleCallback(Handler.java:754)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at oy.a(:com.google.android.gms.policy_ads_fdr_dynamite@21001004@21001004.272763194.272763194)
        at com.google.android.gms.ads.internal.util.f.a(:com.google.android.gms.policy_ads_fdr_dynamite@21001004@21001004.272763194.272763194:1)
        at oy.dispatchMessage(:com.google.android.gms.policy_ads_fdr_dynamite@21001004@21001004.272763194.272763194)
        at android.os.Looper.loop(Looper.java:165)
        at android.app.ActivityThread.main(ActivityThread.java:6375)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)


I have integrated Google Ads with following code
implementation 'com.google.firebase:firebase-ads:18.3.0'

I have integrated MoPub with following code
implementation 'com.google.ads.mediation:mopub:5.8.0.0'
implementation('com.mopub:mopub-sdk:5.10.0@aar') {
transitive = true
exclude module: 'libAvid-mopub' // To exclude AVID
exclude module: 'moat-mobile-app-kit' // To exclude Moat
}

Please suggest a solution for this.


Mobile Ads SDK Forum Advisor Prod

unread,
Nov 17, 2019, 9:31:41 PM11/17/19
to shrin...@gmail.com, google-adm...@googlegroups.com

Hi Shrinidhi,

Thank you for reaching out to us.

It is entirely possible that the ad views for MoPub (from your previous Activity) are leaking as you switch from one Activity to the other. With that in mind, could you try destroying the MoPub ad views during the OnDestroy() lifecycle of your previous Activity? It would look something like this:

@Override
protected void onDestroy() {
if ( mMoPubView != null ){
mMoPubView.destroy();
}
super.onDestroy();
}

If the issue persists despite the above, could you then provide the details below (via Reply privately to author) so that I can further investigate the issue?

  • Ad unit IDs affected
  • Sample project (reproducing the issue)
  • Steps to take in order to replicate the issue


Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team



ref:_00D1U1174p._5001UOCNT5:ref

Mobile Ads SDK Forum Advisor Prod

unread,
Nov 18, 2019, 8:45:39 PM11/18/19
to shrin...@gmail.com, google-adm...@googlegroups.com

Hi Shrinidhi,

I'm afraid that I cannot comment on the severity of the effect that this issue will have on your app's performance, though it's still better if we could work through this issue and have it fixed than not. With that in mind, could you provide the details below (via Reply privately to author) so that I can further investigate the issue?

  • Ad unit IDs affected
  • Sample project (reproducing the issue)
  • Steps to take in order to replicate the issue


Alternatively, you may also forward your concern to the support channels of MoPub, as they may be able to provide insights on this as well.



Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team



ref:_00D1U1174p._5001UOCNT5:ref

Mobile Ads SDK Forum Advisor Prod

unread,
Nov 19, 2019, 3:38:41 AM11/19/19
to shrin...@gmail.com, google-adm...@googlegroups.com

Hi Shrinidhi,

Thank you for providing the requested details in private.

However, I must apologize for the confusion on what I meant by "sample project". Could you kindly send a copy of your sample Android project (not the built APK), via Reply privately to author, that I can use to replicate the issue? I'll be using this project to investigate the cause and possible fix to the issue.



Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team



ref:_00D1U1174p._5001UOCNT5:ref

Mobile Ads SDK Forum Advisor Prod

unread,
Nov 26, 2019, 3:04:41 AM11/26/19
to shrin...@gmail.com, google-adm...@googlegroups.com

Hi Shrinidhi,

I sent a message last November 19 asking for a copy of your sample Android project (not the APK) for investigation purposes. Could you confirm if you've received it? Here is a copy of my previous message:

Mobile Ads SDK Forum Advisor Prod

unread,
Nov 27, 2019, 2:52:30 AM11/27/19
to shrin...@gmail.com, google-adm...@googlegroups.com

Hi Shrinidhi,

Thank you for providing the sample project in private. I can confirm that I received it this time around.

I can also confirm that I was getting the same error logs when I tried out the replication steps. Upon further investigation, it seems that this issue does in fact stem from the MoPub SDK side, given that the logs reference the MoPub SDK as the most recent source of the issue. I would highly recommend that you consult with the support channels of MoPub instead (or refer to existing threads such as this), as I'm afraid that we don't have any insights to provide for such third-party SDKs.



Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team



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