Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

ANR at com.unity3d.services.ads.adunit.VideoPlayerHandler.destroy

Discussion in 'Unity Ads & User Acquisition' started by jperry_oddgames, Jun 25, 2021.

  1. jperry_oddgames

    jperry_oddgames

    Joined:
    Sep 18, 2017
    Posts:
    62
    We had a report come through showing an ANR occurred shortly after the user opened a rewarded ad. See the video here.
    The ad appears to show in portrait orientation for a brief moment, then dies (black screen) after rotating to landscape mode.

    The stacktrace is seen below:
    0 android.media.MediaHTTPConnection.disconnect(MediaHTTPConnection.java:187)
    1 android.media.IMediaHTTPConnection$Stub.onTransact(IMediaHTTPConnection.java:132)
    2 android.os.Binder.execTransactInternal(Binder.java:1021)
    3 android.os.Binder.execTransact(Binder.java:994)
    4 android.media.MediaPlayer._release(Native Method)
    5 android.media.MediaPlayer.release(MediaPlayer.java:2442)
    6 android.widget.VideoView.stopPlayback(VideoView.java:365)
    7 com.unity3d.services.ads.adunit.VideoPlayerHandler.destroy(VideoPlayerHandler.java:38)
    8 com.unity3d.services.ads.adunit.VideoPlayerHandler.onPause(VideoPlayerHandler.java:74)
    9 com.unity3d.services.ads.adunit.AdUnitActivity.onPause(AdUnitActivity.java:219)
    10 android.app.Activity.performPause(Activity.java:8184)
    11 android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1507)
    12 android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:4835)
    13 android.app.ActivityThread.performPauseActivity(ActivityThread.java:4796)
    14 android.app.ActivityThread.handlePauseActivity(ActivityThread.java:4748)
    15 android.app.servertransaction.PauseActivityItem.execute(PauseActivityItem.java:46)
    16 android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:181)
    17 android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:102)
    18 android.app.ActivityThread$H.handleMessage(ActivityThread.java:2239)
    19 android.os.Handler.dispatchMessage(Handler.java:107)
    20 android.os.Looper.loop(Looper.java:237)
    21 android.app.ActivityThread.main(ActivityThread.java:7830)
    22 java.lang.reflect.Method.invoke(Native Method)
    23 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    24 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1040)

    Callstacks for other threads can be found in the *callstack.txt attachment.
     

    Attached Files:

  2. fugstudio

    fugstudio

    Joined:
    Mar 22, 2018
    Posts:
    3
    I encountered same issue ,did you have any solution ?
     
  3. abrahanstd

    abrahanstd

    Joined:
    Jun 25, 2021
    Posts:
    3
    [QUOTE = "fugstudio, post: 7304332, member: 1748565"] Encontré el mismo problema, ¿tiene alguna solución? [/ QUOTE]
    Hola podrias ayudarme
     
  4. jperry_oddgames

    jperry_oddgames

    Joined:
    Sep 18, 2017
    Posts:
    62
    Unfortunately we haven't made any progress on this one, and we can't reproduce it so I can't create a bug report. Kinda hoping this thread is seen by someone in the ads department that might be able to help
     
  5. slavomirbanas

    slavomirbanas

    Joined:
    Jun 1, 2020
    Posts:
    5
    Same problem here
     
  6. Mest

    Mest

    Joined:
    Nov 7, 2012
    Posts:
    18
    Hey guys!
    I have nearly the same ANR-Message (but with another ad-provider). I try to fix this for nearly 1,5 year now... I had contact with the company and we have eliminated the ANR for 100%, but with ad-revenue-loss of 50-70%... So that was not a solution (they told me, they disabled most of their third-party ad-provider to "fix" the ANR).

    Now since nearly a year, they told me they are trying to investigate further...

    Let's try to find possible similarities, since it seems to need some conditions for this ANR:
    1. Do you have limited Orientations ("ProjectSettings/Player/Resolution & Presentation/Allowed Orentations...")?
    2. Do you use a "Custom Proguard File"?
    3. "ProjectSettings/Player/OtherSettings/ScriptingBackend"
    4. Whats your "ProjectSettings/Audio"-values for:
      1. "SystemSampleRate"
      2. "DSP-Buffer Size"
    5. What are the affected android versions of this ANR (if you click on the ANR-Details in the PlayConsole, you can see a bar-diagram for that)

    Here are mine:
    1. only "Portrait" & "Portrait Upside Down" are allowed
    2. Yes, we use a Proguard-File
    3. IL2CPP
    4. 48000 & "Best Performance
    5. its only Android 10 & 11 & 12 (on the time 30.03.22)

    If you have any other ideas or questions to find similarities: go ahead :)
     
  7. Shefich

    Shefich

    Joined:
    May 23, 2013
    Posts:
    147
    Almost the same for me:

    1. only "Portrait" & "Portrait Upside Down" are allowed
    2. Yes for Proguard-file
    3. Il2cpp, .NET4.x
    4. Different settings.
    5. Android 11 & 12

    I am using Admob mediation and these errors come from Unity Ads SDK for Admob Mediation.
     
  8. Shefich

    Shefich

    Joined:
    May 23, 2013
    Posts:
    147
    Any news? Have somebody found the issue?
     
  9. Shefich

    Shefich

    Joined:
    May 23, 2013
    Posts:
    147
    More stack traces:

    Code (CSharp):
    1. Binder:16115_5 (native)
    2. tid=182 systid=16876
    3. Root blocking
    4. IO Root blocking
    5. 0
    6. libc.so
    7. read
    8. 1
    9. libc.so
    10. __sread
    11. 2
    12. libc.so
    13. __srefill
    14. 3
    15. libc.so
    16. fread_unlocked
    17. 4
    18. libc.so
    19. fread
    20. 5
    21. libc.so
    22. android_getaddrinfo_proxy
    23. 6
    24. libc.so
    25. android_getaddrinfofornetcontext
    26. 7
    27. libc.so
    28. android_getaddrinfofornet
    29. 8
    30. libjavacore.so
    31. Linux_android_getaddrinfo(_JNIEnv*, _jobject*, _jstring*, _jobject*, int)
    32. libcore.io.Linux.android_getaddrinfo (Native method)
    33. libcore.io.ForwardingOs.android_getaddrinfo (ForwardingOs.java:73)
    34. libcore.io.BlockGuardOs.android_getaddrinfo (BlockGuardOs.java:202)
    35. libcore.io.ForwardingOs.android_getaddrinfo (ForwardingOs.java:73)
    36. java.net.Inet6AddressImpl.lookupHostByName (Inet6AddressImpl.java:135)
    37. java.net.Inet6AddressImpl.lookupAllHostAddr (Inet6AddressImpl.java:103)
    38. java.net.InetAddress.getAllByName (InetAddress.java:1152)
    39. com.android.okhttp.Dns$1.lookup (Dns.java:41)
    40. com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress (RouteSelector.java:178)
    41. com.android.okhttp.internal.http.RouteSelector.nextProxy (RouteSelector.java:144)
    42. com.android.okhttp.internal.http.RouteSelector.next (RouteSelector.java:86)
    43. com.android.okhttp.internal.http.StreamAllocation.findConnection (StreamAllocation.java:176)
    44. com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection (StreamAllocation.java:128)
    45. com.android.okhttp.internal.http.StreamAllocation.newStream (StreamAllocation.java:97)
    46. com.android.okhttp.internal.http.HttpEngine.connect (HttpEngine.java:302)
    47. com.android.okhttp.internal.http.HttpEngine.sendRequest (HttpEngine.java:245)
    48. com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute (HttpURLConnectionImpl.java:465)
    49. com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse (HttpURLConnectionImpl.java:411)
    50. com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode (HttpURLConnectionImpl.java:542)
    51. com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode (DelegatingHttpsURLConnection.java:106)
    52. com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode (HttpsURLConnectionImpl.java:30)
    53. android.media.MediaHTTPConnection.seekTo (MediaHTTPConnection.java:285)
    54. android.media.MediaHTTPConnection.getMIMEType (MediaHTTPConnection.java:465)
    55. android.media.IMediaHTTPConnection$Stub.onTransact (IMediaHTTPConnection.java:159)
    56. android.os.Binder.execTransactInternal (Binder.java:1174)
    57. android.os.Binder.execTransact (Binder.java:1126)
    58.  
    59. main (blocked)
    60. tid=1 systid=16115 | waiting to lock <0x006b1500> (android.media.MediaHTTPConnection) held by thread 182
    61. Triggered ANR
    62. android.media.MediaHTTPConnection.disconnect (MediaHTTPConnection.java:172)
    63. android.media.IMediaHTTPConnection$Stub.onTransact (IMediaHTTPConnection.java:132)
    64. android.os.Binder.execTransactInternal (Binder.java:1174)
    65. android.os.Binder.execTransact (Binder.java:1126)
    66. android.media.MediaPlayer._release (Native method)
    67. android.media.MediaPlayer.release (MediaPlayer.java:2121)
    68. android.widget.VideoView.stopPlayback (VideoView.java:365)
    69. com.unity3d.services.ads.adunit.VideoPlayerHandler.destroy (VideoPlayerHandler.java:38)
    70. com.unity3d.services.ads.adunit.VideoPlayerHandler.onPause (VideoPlayerHandler.java:74)
    71. com.unity3d.services.ads.adunit.AdUnitActivity.onPause (AdUnitActivity.java:219)
    72. android.app.Activity.performPause (Activity.java:8263)
    73. android.app.Instrumentation.callActivityOnPause (Instrumentation.java:1516)
    74. android.app.ActivityThread.performPauseActivityIfNeeded (ActivityThread.java:5013)
    75. android.app.ActivityThread.performPauseActivity (ActivityThread.java:4974)
    76. android.app.ActivityThread.handlePauseActivity (ActivityThread.java:4925)
    77. android.app.servertransaction.PauseActivityItem.execute (PauseActivityItem.java:46)
    78. android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
    79. android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
    80. android.app.ActivityThread$H.handleMessage (ActivityThread.java:2203)
    81. android.os.Handler.dispatchMessage (Handler.java:106)
    82. android.os.Looper.loop (Looper.java:268)
    83. android.app.ActivityThread.main (ActivityThread.java:8019)
    84. java.lang.reflect.Method.invoke (Native method)
    85. com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:627)
    86. com.android.internal.os.ZygoteInit.main (ZygoteInit.java:997)
     
  10. cathryn_mataga

    cathryn_mataga

    Joined:
    Apr 21, 2022
    Posts:
    3
    I have basic this same callstack, but with the Android version of IronSource, not Unity. I don't think this is related to Unity or the Unity plugin for IronSource. But either something in native Android code with IronSource or an Android bug. It does seem to have shown up around Android 10+, so suspect that.
     
  11. Shefich

    Shefich

    Joined:
    May 23, 2013
    Posts:
    147
    I faced this issue with Admob mediation and with Native Unity Ads. So possibly it connected to the native unity video player code and it is Unity's issue. I have tried also different unity versions.