Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity Ads crashes randomly after upgrading from 5.4.1 to 5.6.1f

Discussion in 'Unity Ads & User Acquisition' started by UDN_43669de3-ec6d-40c1-a4bf-667a587956b4, May 20, 2017.

  1. UDN_43669de3-ec6d-40c1-a4bf-667a587956b4

    UDN_43669de3-ec6d-40c1-a4bf-667a587956b4

    Joined:
    Sep 30, 2016
    Posts:
    6
    I've just upgraded Unity from 5.4.1 to 5.6.1f.
    Without changing any codes, I see Unity Ads crashes randomly in the new version of my game.
    This happens very often on Galaxy S5. I tried to reduce memory usage by half, but the bug still occurs.
    Unfortunately, I don't have Galaxy S5, so I can't reproduce the bug.
    Even though few players are affected by this bug (Around 0.1% of players),
    it definitely decreases the ratings and interrupts players' experience.

    The following are user messages:
    - crashes after every advert
    - After ads played, the game log out itself
    - every time it goes to a ad and you return to the game it stops working

    The following is the example stack:
    java.lang.Error: FATAL EXCEPTION [main]
    Unity version : 5.6.1f1
    Device model : samsung SM-G900F
    Device fingerprint: samsung/kltexx/klte:6.0.1/MMB29M/G900FXXS1CPK1:user/release-keys
    Caused by: java.lang.OutOfMemoryError: Failed to allocate a 8294412 byte allocation with 6964264 free bytes and 6MB until OOM
    at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
    at android.graphics.Bitmap.nativeCreate(Native Method)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:975)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:946)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:877)
    at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:753)
    at com.unity3d.player.i.onLayoutChange(Unknown Source)
    at android.view.View.layout(View.java:17947)
    at android.view.ViewGroup.layout(ViewGroup.java:5812)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
    at android.view.View.layout(View.java:17938)
    at android.view.ViewGroup.layout(ViewGroup.java:5812)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1742)
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
    at android.view.View.layout(View.java:17938)
    at android.view.ViewGroup.layout(ViewGroup.java:5812)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
    at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:3193)
    at android.view.View.layout(View.java:17938)
    at android.view.ViewGroup.layout(ViewGroup.java:5812)
    at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2666)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2367)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1437)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7397)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920)
    at android.view.Choreographer.doCallbacks(Choreographer.java:695)
    at android.view.Choreographer.doFrame(Choreographer.java:631)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7224)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

    Any ideas what to do?
     
    Last edited: May 20, 2017
  2. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    What is the game? Can try to see if we can reproduce here.

    /Rasmus
     
  3. UDN_43669de3-ec6d-40c1-a4bf-667a587956b4

    UDN_43669de3-ec6d-40c1-a4bf-667a587956b4

    Joined:
    Sep 30, 2016
    Posts:
    6
    Hello Rasmus,

    I think it's the same bug from this thread:
    https://forum.unity3d.com/threads/5...y-affecting-a-device-on-android-6-0-1.466367/

    8294412 bytes from the crash stack is the file size of my static splash image.
    Players get this crash when they close the ads and return to the game.
    Both crash stacks also look exactly the same.
    They both occurred in 5.6.X

    I just reduced its size this morning and currently waiting for crash reports to confirm this.

    Another thing to note is that my static splash image is 1080x1920.
    Every device that gets this crash has 1080x1920 screen size.

    PS. the game name is "Just 2 Pics"

    Best,
    Jess
     
    Last edited: May 21, 2017
  4. UDN_43669de3-ec6d-40c1-a4bf-667a587956b4

    UDN_43669de3-ec6d-40c1-a4bf-667a587956b4

    Joined:
    Sep 30, 2016
    Posts:
    6
    Hello Rasmus,

    After I adjusted my static splash image size to 528x940 (smaller with weird aspect ratio),
    the number of crash reports decreased from 3000 reports a day to 1-2 reports a day.

    So there's definitely something wrong with static splash screen in Unity 5.6.X,
    please investigate and fix the issue as soon as possible.
    A low resolution splash screen looks horrible :(

    I'm not gonna submit a bug report, because it's the same bug from this thread:
    https://forum.unity3d.com/threads/5...y-affecting-a-device-on-android-6-0-1.466367/

    Best,
    Jess
     
    Last edited: May 23, 2017