Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Unity Ads crash on some Android 10 devices

Discussion in 'Unity Ads & User Acquisition' started by GarlicDipping, Dec 21, 2019.

  1. GarlicDipping

    GarlicDipping

    Joined:
    Sep 7, 2013
    Posts:
    33
    On our production app, we got some reports from users that game crashes sometimes. After checking google play console's crash reports, we noticed that there seems like some problem exists within unity ads caching library on Android 10, Galaxy S 10+.(Unity 2017.4 LTS 35f)

    Here's the crash report :

    java.lang.Error: FATAL EXCEPTION [UnityAdsCacheThread]
    Unity version : 2017.4.35f1
    Device model : samsung SM-G975N

    at java.util.zip.Inflater.ensureOpen (Inflater.java:416)
    at java.util.zip.Inflater.inflate (Inflater.java:276)
    at com.android.okhttp.okio.InflaterSource.read (InflaterSource.java:69)
    at com.android.okhttp.okio.GzipSource.read (GzipSource.java:82)
    at com.android.okhttp.okio.RealBufferedSource$1.read (RealBufferedSource.java:397)
    at java.io.BufferedInputStream.fill (BufferedInputStream.java:248)
    at java.io.BufferedInputStream.read1 (BufferedInputStream.java:288)
    at java.io.BufferedInputStream.read (BufferedInputStream.java:347)
    at java.io.FilterInputStream.read (FilterInputStream.java:107)
    at com.unity3d.ads.request.WebRequest.makeStreamRequest (WebRequest.java:190)
    at com.unity3d.ads.cache.CacheThreadHandler.downloadFile (CacheThreadHandler.java:127)
    at com.unity3d.ads.cache.CacheThreadHandler.handleMessage (CacheThreadHandler.java:62)
    at android.os.Handler.dispatchMessage (Handler.java:107)
    at android.os.Looper.loop (Looper.java:237)
    at com.unity3d.ads.cache.CacheThread.run (CacheThread.java:47)

    It seems like not EVERY users are affected from this crash, but any workarounds or fixes will be appreciated. Thanks!
     
  2. Voresh

    Voresh

    Joined:
    Mar 7, 2015
    Posts:
    4
    Got the same crash:

    java.lang.Error:
    FATAL EXCEPTION [UnityAdsCacheThread]
    Unity version : 2019.1.13f1
    Device model : samsung SM-G973F
    Caused by
    at java.util.zip.Inflater.ensureOpen (Inflater.java:416)
    at java.util.zip.Inflater.inflate (Inflater.java:276)
    at com.android.okhttp.okio.InflaterSource.read (InflaterSource.java:69)
    at com.android.okhttp.okio.GzipSource.read (GzipSource.java:82)
    at com.android.okhttp.okio.RealBufferedSource$1.read (RealBufferedSource.java:397)
    at java.io.BufferedInputStream.fill (BufferedInputStream.java:248)
    at java.io.BufferedInputStream.read1 (BufferedInputStream.java:288)
    at java.io.BufferedInputStream.read (BufferedInputStream.java:347)
    at java.io.FilterInputStream.read (FilterInputStream.java:107)
    at com.unity3d.services.core.request.WebRequest.makeStreamRequest (WebRequest.java:190)
    at com.unity3d.services.core.cache.CacheThreadHandler.downloadFile (CacheThreadHandler.java:136)
    at com.unity3d.services.core.cache.CacheThreadHandler.handleMessage (CacheThreadHandler.java:70)
    at android.os.Handler.dispatchMessage (Handler.java:107)
    at android.os.Looper.loop (Looper.java:237)
    at com.unity3d.services.core.cache.CacheThread.run (CacheThread.java:47)

    I am using advertisment package v3.4.1
     
  3. RaL

    RaL

    Joined:
    Nov 29, 2013
    Posts:
    35
    Same here. Any ideas?
     
  4. AliAlbarrak

    AliAlbarrak

    Joined:
    Jan 24, 2018
    Posts:
    15
    We have the same issue here


    Code (csharp):
    1. java.lang.Error: FATAL EXCEPTION [UnityAdsCacheThread]
    2. Unity version     : 2019.1.14f1
    3. Device model      : samsung SM-N975F
    4. Device fingerprint: samsung/d2sxx/d2s:10/QP1A.190711.020/N975FXXU1BSL7:user/release-keys
    5. Caused by
    6.   at java.util.zip.Inflater.ensureOpen (Inflater.java:416)
    7.   at java.util.zip.Inflater.inflate (Inflater.java:276)
    8.   at com.android.okhttp.okio.InflaterSource.read (InflaterSource.java:69)
    9.   at com.android.okhttp.okio.GzipSource.read (GzipSource.java:82)
    10.   at com.android.okhttp.okio.RealBufferedSource$1.read (RealBufferedSource.java:397)
    11.   at java.io.BufferedInputStream.fill (BufferedInputStream.java:248)
    12.   at java.io.BufferedInputStream.read1 (BufferedInputStream.java:288)
    13.   at java.io.BufferedInputStream.read (BufferedInputStream.java:347)
    14.   at java.io.FilterInputStream.read (FilterInputStream.java:107)
    15.   at com.unity3d.services.core.request.WebRequest.makeStreamRequest (WebRequest.java:190)
    16.   at com.unity3d.services.core.cache.CacheThreadHandler.downloadFile (CacheThreadHandler.java:136)
    17.   at com.unity3d.services.core.cache.CacheThreadHandler.handleMessage (CacheThreadHandler.java:70)
    18.   at android.os.Handler.dispatchMessage (Handler.java:107)
    19.   at android.os.Looper.loop (Looper.java:237)
    20.   at com.unity3d.services.core.cache.CacheThread.run (CacheThread.java:47)
     
  5. sbankhead

    sbankhead

    Unity Technologies

    Joined:
    Jul 27, 2014
    Posts:
    97
    It looks to be a fatal exception from a BufferedInputStream read call. While we don't have a repro case for this, we believe there is a way to mitigate the crash event and are looking in to pushing out a fix in our next release. Ill try to keep you updated when I get the fix merged in and know the expected release it will go out with.
     
  6. kaiyanglim

    kaiyanglim

    Joined:
    Jan 26, 2020
    Posts:
    1
    same issue.
     
  7. daltasaeed

    daltasaeed

    Joined:
    Nov 8, 2018
    Posts:
    1
    I've got the same issue.
     
  8. a_naumuk

    a_naumuk

    Joined:
    Dec 10, 2018
    Posts:
    8
    Any updates? I have same problem. The problem mainly happens on Samsung devices with Android 10
     
  9. Shefich

    Shefich

    Joined:
    May 23, 2013
    Posts:
    144
    Hi, same error.
    Samsung devices S10, S10+, S10e. Android 10
    Unity 2018.4.14f1
    Unity Ads 2.0.8
     
  10. a_naumuk

    a_naumuk

    Joined:
    Dec 10, 2018
    Posts:
    8
    FYI I've sent ticket to Unity support and it turns out they are aware of the problem. The fix is already shipped in 3.4.2 version of Unity Ads SDK
     
    Shefich likes this.
  11. Shefich

    Shefich

    Joined:
    May 23, 2013
    Posts:
    144
    I switched to admob mediation and it forced me to remove unity ads sdk and use just admob-unity-mediation.
    And now I see such error, still on Android 10 samsung devices:

    Code (CSharp):
    1. Caused by java.lang.NullPointerException: Inflater has been closed
    2.        at java.util.zip.Inflater.ensureOpen + 416(Inflater.java:416)
    3.        at java.util.zip.Inflater.inflate + 276(Inflater.java:276)
    4.        at com.android.okhttp.okio.InflaterSource.read + 69(InflaterSource.java:69)
    5.        at com.android.okhttp.okio.GzipSource.read + 82(GzipSource.java:82)
    6.        at com.android.okhttp.okio.RealBufferedSource$1.read + 397(RealBufferedSource.java:397)
    7.        at java.io.BufferedInputStream.fill + 248(BufferedInputStream.java:248)
    8.        at java.io.BufferedInputStream.read1 + 288(BufferedInputStream.java:288)
    9.        at java.io.BufferedInputStream.read + 347(BufferedInputStream.java:347)
    10.        at java.io.FilterInputStream.read + 107(FilterInputStream.java:107)
    11.        at com.unity3d.services.core.request.WebRequest.makeStreamRequest + 190(WebRequest.java:190)
    12.        at com.unity3d.services.core.cache.CacheThreadHandler.downloadFile + 136(CacheThreadHandler.java:136)
    13.        at com.unity3d.services.core.cache.CacheThreadHandler.handleMessage + 70(CacheThreadHandler.java:70)
    14.        at android.os.Handler.dispatchMessage + 107(Handler.java:107)
    15.        at android.os.Looper.loop + 237(Looper.java:237)
    16.        at com.unity3d.services.core.cache.CacheThread.run + 47(CacheThread.java:47)
     
  12. sbankhead

    sbankhead

    Unity Technologies

    Joined:
    Jul 27, 2014
    Posts:
    97
    @Shefich Can you confirm which version of the ads sdk your using in mediation? We were never able to reproduce this issue locally, and still can't but we adjusted some of the error handling logic around this stack trace in an attempt to better capture this exception and stop it from causing an ANR. That fix was pushed into the 3.4.2 ads sdk and so if your not using that in mediation, then you could still be hitting the same issue as with direct integration. If you are using that in mediation, then please let us know so that we can continue to investigate this issue.
     
  13. Shefich

    Shefich

    Joined:
    May 23, 2013
    Posts:
    144
    I'm using Admob Unity mediation 2.4.0 from this link: https://bintray.com/google/mobile-a...iation#files/GoogleMobileAdsUnityAdsMediation
    As I couldn't use mediation with any Unity Ads SDK, I removed it completely from the project. And now only Admob library and this little mediation file.

    For now, I can't see exact the same error in Fabric.