Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Game Crashes on Some Android Devices "Randomly"

Discussion in 'Android' started by TeorikDeli, Oct 18, 2014.

  1. TeorikDeli

    TeorikDeli

    Joined:
    Apr 6, 2014
    Posts:
    117
    Hi. I'm developing a game with Unity Free for mobile devices. There were no any crashes until today, when I tested my game on a friend's Sony Z2. I already tested game on iOS Simulators, iPad 3, iPhone 5, iPhone 4, Asus Memo Pad 8, HTC One, Galaxy S2, Asus TF201, Sony Xperia S (and some other Android devices too, but I don't know their names) and no crashes. Only problem was on iPhone 4 due to FPS, but I didn't optimized the game yet.

    This crash occurs when I "Instantiate" a prefab, I think. If I touch on a specific trigger collider, I "Instantiate" a prefab. I'm using OnMouseDown() for this (I think much easier to use than touch events). There is no performance problem on most devices (only on iPhone 4). On Z2, there is no specific way to crash the game; either I tap too much (and quick) or tap less (and slow) game crashes at some point.

    I logcat the game, but there is two different errors (Unity Main and UnityGfxDeviceW) for multiple logging sessions.

    One is:
    Other is:

    I think there is something wrong with memory management, bu I'm not sure what causes this. OnMouseDown() or "Instantiate" prefab or something else (maybe an Unity bug)? Do you have any ideas?

    Do I really have to use touch events instead of OnMouseDown() for example?

    Thanks.

    Unity version: 4.5.5 (Mac)
    ADT Verison: 20140702

    --------------
    Edit/Update: I removed "Instantiate" prefab things, nothing changed. I also updated OnMouseDown to touch events, nothing changed. I'm out of ideas to solve this problem, I guess.
     
    Last edited: Oct 19, 2014
  2. TeorikDeli

    TeorikDeli

    Joined:
    Apr 6, 2014
    Posts:
    117
    Really, no one? I haven't still sorted out it. I also updated Unity (4.5.5p1). By the way, Z2's Android version is 4.4.2. My friend cannot update it to 4.4.4; maybe its android version causes this problem?
     
  3. Dzxyan

    Dzxyan

    Joined:
    Sep 23, 2013
    Posts:
    167
    maybe your OnMouseDown event let it crash?
    some function that not compatibility with iphone4?
    maybe your garbage overload?
    that a lot of possibility ,
    difficult to say.
     
  4. TeorikDeli

    TeorikDeli

    Joined:
    Apr 6, 2014
    Posts:
    117
    Thanks for your reply @Dzxyan , but I already tried to change OnMouseDown event to touch event and also removed prefab creating codes, but nothing changed. I don't have a problem with iPhone 4, cause I'm using too big camera view and textures right now, I'll optimize it later. About garbage, I destroy all created prefabs after 10 to 20 seconds; I don't know what else could overloads in game, cause there are really not much variables in game. And also, in Z2, game can chrash in few seconds or tens seconds.

    I also installed 4.5.5p2 =) So far, the only problem with Sony Xperia Z2.
     
  5. fertigo

    fertigo

    Joined:
    Feb 15, 2014
    Posts:
    19
    We have the same problem here, also on Z2 though I didn't test extensively on iOS yet. I use Unity 4.6 beta 20.

    It seems that forcing Open GL ES 2.0 solves the problem. Please let us know if it solves your problem too.
     
  6. TeorikDeli

    TeorikDeli

    Joined:
    Apr 6, 2014
    Posts:
    117
    Thanks @fertigo ! I'll try this soon and let you know.
     
  7. Defero

    Defero

    Joined:
    Jul 9, 2012
    Posts:
    200
    I had a similar problem that only occurred on my htc desire s. I had a buch of simple prefabs that i instantiated and then destroyed. But after i started pooling everything the problem disappeared.

    So in my case the SIGSEGV error was caused from destroying these prefabs.
     
  8. TeorikDeli

    TeorikDeli

    Joined:
    Apr 6, 2014
    Posts:
    117
    @Defero I'll also use pooling in the future, but forcing game to OpenGL ES 2.0 -as @fertigo said- solved the problem. Thank you all!

    So, basically this is a bug, right? But not because of Unity?
     
  9. johansan

    johansan

    Joined:
    Nov 7, 2014
    Posts:
    3
    I had this issue as well. Forcing Open GL ES 2.0 for Android fixed it for me. Using Unity 4.5.5p5 and a Nexus 4 (Android 5).
     
  10. bariscigal

    bariscigal

    Joined:
    Oct 26, 2009
    Posts:
    46
    I had this exact error reported on Google play. I "was" using the open gl es 2.0 rendering .
    Unity 4.5.5 f1 and it seems the crash is on Moto Maxx Android 4.4

    Code (CSharp):
    1. *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    2. Build fingerprint: 'motorola/obake-maxx_verizon/obake-maxx:4.4.4/SU5-24/24:user/release-keys'
    3. Revision: 'p300'
    4. pid: 8005, tid: 8025, name: UnityGfxDeviceW >>> com.Badu.BountyHunt <<<
    5. signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000008c
    6. r0 0000008c r1 ffffffff r2 00000001 r3 0000008c
    7. r4 0000008c r5 6248f114 r6 6248eb44 r7 00000001
    8. r8 6248edb4 r9 6f56a528 sl 00000320 fp 6248eacc
    9. ip 5f6fc8cc sp 6248ea78 lr 5f4b2da8 pc 40061810 cpsr 200f0010
    10. d0 000000000000000f d1 3263323232303030
    11. d2 65747379732f2020 d3 696c2f62696c2f6d
    12. d4 0000000000000000 d5 00000000bb360f1b
    13. d6 3ef60b8000000000 d7 3f80000000000000
    14. d8 0000000000000000 d9 0000000000000000
    15. d10 0000000000000000 d11 0000000000000000
    16. d12 0000000000000000 d13 0000000000000000
    17. d14 0000000000000000 d15 0000000000000000
    18. d16 5f28206f732e6362 d17 5f7970636d656d5f
    19. d18 6c6c615f64616572 d19 6c6165643031636f
    20. d20 5045657461636f6c d21 31335f534e506a76
    21. d22 646165726874505f d23 705f636f6c6c615f
    22. d24 000000003ba1d48a d25 0000000000000000
    23. d26 3b360f1b00000000 d27 0000000000000000
    24. d28 0000000000000000 d29 0000000039ab5983
    25. d30 3ef60b8000000000 d31 3f8000003f078788
    26. scr 60000092
     
  11. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I think this is fixed in 4.6.1 Final, look changelog many Android fixes.
     
  12. florianpenzkofer

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    479
    Unity 4.6.1f1 doesn't have any Android fixes that haven't already been in 4.6.0p1. A fix for random crashes on Adreno, ES3 running new Android versions (e.g. Nexus 4, ES3, Android 5.0) is prepared for 4.6.1p1.
     
    RaiseZUp likes this.
  13. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Thank you for making this clear, I thought I saw something in the changelog about this in 4.6.1 but I guess was my mistake. One other offtopic qustion, do you know how BlackBerry responds - I know it suffers from (Blur/Shader) issues similar to Android in some of there latest firmware.
     
  14. kunalxigxag

    kunalxigxag

    Joined:
    Aug 7, 2014
    Posts:
    9
    I had the same issue on Samsung galaxy A5 ( which just came this year). Forcing OpenGL ES 2.0 solved it.
    Thanks for mentioning else I was worried.
    My app worked fine on Galaxy s3 ( which came out in 2012), S5, Nexus 7, galaxy note 10.1 ( 2013). but for A5, it was crashing. On Unity 4.6.1f1