-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
void com.google.ads.interactivemedia.v3.api.AdsManager.resume() nullpointer exception #3879
Comments
Which ExoPlayer version are you using? I can't see a path where we fail to load ads (meaning that the ads manager is null) but IMA has paused content, which would trigger this error. I can't reproduce this issue in the demo app. If you can reproduce this issue please could you set the |
I am using both exoplayer and IMAextension having version 2.6.1. I can''t really access ImaAdsLoader class as I am calling lib from gradle. |
When do you release the |
Closing on the assumption the suggestion by @andrewlewis was the problem, due to lack of follow up. If that's not the issue, please reply here and we'll re-open the issue. |
Hi @ojw28 , @andrewlewis It seems this is happening due to a race condition when releasing a "paused" IMA and player/media source being prepared. We are not able to reproduce it on our current tapplication or the IMA demo without forcing it, but NPEs are still being reported on our trackers after we have upgraded to Exo 2.7.x One easy way to force it on the IMA demo is:
The race condition seems to be happening on A possible fix could be clearing the Let me know if you need something else. |
@fpittersacc Thanks for the information! Is it possible that the application is releasing the player immediately after initializing (as you say), but then the app is also calling I think this is the same as what you said but it's the fact that the If this makes sense, I can fix it by making the attach/detach methods no-ops if the loader is already released. |
@fpittersacc Does the suggestion above make sense? Is it possible that your app releases the |
Closing due to lack of updates. |
@andrewlewis , sorry I've missed you questions. Yes, we are releasing the player and the ImaAdsLoader at the same time on some situations, so it's the queued runnable running after ImaAdsLoader has been released. We have included a Let me know if I can help with anything. |
I have a similar NPE appearing in our crashlogs. But it's on start() instead of resume.
|
@brinkkemper This suggests IMA is calling @fpittersacc Using a flag should work. I'll plan to make a fix, either using a flag or by checking for queued attach messages in detach, and removing them if present. (The latter is a bit more code but would work for all |
Issue: #3879 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=202100576
Issue: #3879 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=202100576
Hi Team,
When pre roll ad is playing and app goes in background and comes back in foreground, app crashes. Here is the stack trace.
FATAL EXCEPTION: main Process: PID: 22373 java.lang.NullPointerException: Attempt to invoke interface method 'void com.google.ads.interactivemedia.v3.api.AdsManager.resume()' on a null object reference at com.google.android.exoplayer2.ext.ima.ImaAdsLoader.attachPlayer(ImaAdsLoader.java:396) at com.google.android.exoplayer2.source.ads.AdsMediaSource$2.run(AdsMediaSource.java:219) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6809) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Here are my onresume and onpause methods of fragment:
@Override public void onResume() { super.onResume(); player.init(getActivity(), playerView); }
@Override public void onPause() { super.onPause(); player.reset(); player.release(); playerView.getPlayer().release(); }
Please help me with the same.
The text was updated successfully, but these errors were encountered: