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

Weird crash bug on Android 5.0 Lollipop, only when installed from Google Play Store

Discussion in 'Android' started by Sahara, Nov 12, 2014.

  1. Sahara

    Sahara

    Joined:
    Nov 11, 2014
    Posts:
    1
    Hi,

    I found a weird crash bug, help me find out the cause of it!

    On the following Java code called by Unity's AndroidJavaObject, somehow it crashes with SIGSEGV on Android 5.0 when just a NullPointerException is thrown. "a.toString" causes NullPointerException and the exception is always catched and NEVER crashes on Android 4.4 and older.

    Code (Java):
    1. // Called from Unity C# like: (new AndroidJavaObject("jp.co.cyberz.TestUnityException")).Call("test");
    2. public void test(){
    3.   try {
    4.     String a = null;
    5.     a.toString(); // CRASH!!
    6.   } catch (Exception e) {
    7.   }
    8. }
    (Uploaded the project at Dropbox)

    logcat:
    Crashes on the following conditions.
    • Installed from the Google Play Store(To check, uploaded at the store )
    • Unity 4.2.2 and older versions
    • Running on Android 5.0, not on Android 4.4 w/ ART runtime
    I know I can fix it by upgrading Unity version, but I cannot. I provide SDKs and must support the older versions.

    Do you have any idea about the cause, or does anybody encounter it?
    I cannot believe it crashes only when installed from the Google Play store...
     
    msintov likes this.
  2. msintov

    msintov

    Joined:
    Nov 13, 2014
    Posts:
    1
    We are having the exact same problem. I have a NullPointerException thrown from Java code within Unity 4.2 games, and they all crash, *only* when downloaded from the Google Play Store on Android 5.0. This did not happen on Android 4.*, and it doesn't happen when the apk is sideloaded via adb install, and it doesn't happen on Unity 4.3.

    In our case, the crashing code is:

    JSONObject myObject;
    String s = null
    try {
    myObject = new JSONObject(s); // <--- crash here
    }
    catch (Exception e) {
    }

    We have about 30+ games with this problem.

    I also posted a bug against Android here (many many thanks to Sahara for the sample):
    https://code.google.com/p/android/issues/detail?id=79288&thanks=79288&ts=1415920385
     
    Last edited: Nov 14, 2014
  3. Cenda

    Cenda

    Joined:
    Jun 3, 2010
    Posts:
    66
    I just updated my phone to Android 5 and it is crashing during start with:

    11-18 18:56:15.624 5289-5316/? E/qdutils﹕ FBIOGET_FSCREENINFO failed
    11-18 18:56:16.013 5289-5316/? A/libc﹕ heap corruption detected by dlfree
    11-18 18:56:16.013 5289-5316/? A/libc﹕ Fatal signal 6 (SIGABRT), code -6 in tid 5316 (UnityMain)
     
  4. klinakuf

    klinakuf

    Joined:
    Feb 5, 2014
    Posts:
    1
    Hello guys,

    I am having the same problem only on Android 5 L,

    Device model : LGE Nexus 5
    Device fingerprint: google/hammerhead/hammerhead:5.0/LRX21O/1570415:user/release-keys

    Caused by: java.lang.Error: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000018
    Build fingerprint: 'google/hammerhead/hammerhead:5.0/LRX21O/1570415:user/release-keys'
    Revision: '11'
     
  5. BlackPanda

    BlackPanda

    Joined:
    Jan 24, 2014
    Posts:
    78
    Same here. In Nexus 4 on Android 5.0.0. Did you guys find a solution to this?? I'm using Unity 4.6.0f1.
     
  6. GamenamiGames

    GamenamiGames

    Joined:
    Sep 16, 2014
    Posts:
    7
    BlackPanda likes this.
  7. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    880
    Did 4.6.1p2 fix this for any of you guys?
     
  8. BlackPanda

    BlackPanda

    Joined:
    Jan 24, 2014
    Posts:
    78
    I'll give update on that today itself. Btw, 4.6.0f1 has this bug too.
     
  9. thoorne

    thoorne

    Joined:
    Jul 22, 2012
    Posts:
    64
    I'm also getting random SIGSEGV errors. I'm using Unity 4.6.1p2. Process is just dying with no apparent reason and without any logs or stacktraces.
     
  10. spotavi

    spotavi

    Joined:
    Aug 30, 2014
    Posts:
    31
    The exact unity build that resolves this issues is 4.3.1 . Find it here : http://unity3d.com/unity/download/archive .

    We used this build to publish to play store and solve those crashes. ( Just a workaround to avoid those bad 1 star ratings :( )
     
  11. spotavi

    spotavi

    Joined:
    Aug 30, 2014
    Posts:
    31
  12. thoorne

    thoorne

    Joined:
    Jul 22, 2012
    Posts:
    64
    Sadly 4.3.1 doesn't include new GUI so it's not a deal for me.
     
    spotavi likes this.
  13. spotavi

    spotavi

    Joined:
    Aug 30, 2014
    Posts:
    31
    Exactly !! Using the new unity ui and stuck with this bug :(
     
  14. BlackPanda

    BlackPanda

    Joined:
    Jan 24, 2014
    Posts:
    78
    Same here. New ui. :confused: :( Can't go back.
     
    spotavi likes this.
  15. BlackPanda

    BlackPanda

    Joined:
    Jan 24, 2014
    Posts:
    78
    4.6.1.p2 worked! Issue solved in Android 5! :)
     
  16. spotavi

    spotavi

    Joined:
    Aug 30, 2014
    Posts:
    31
    Thanks for the update BlackPanda. Will install again and try it fresh !
     
  17. thoorne

    thoorne

    Joined:
    Jul 22, 2012
    Posts:
    64
  18. breaker2005

    breaker2005

    Joined:
    Feb 22, 2013
    Posts:
    26
    Yes i came to this same conclusion. But it happens not only when app is downloaded from google play.
     
  19. jtbentley

    jtbentley

    Joined:
    Jun 30, 2009
    Posts:
    1,397
    We're also having issues with Unity 4.6.2 building and a crash on a Nexus 6 running android 5.0.1, about a split second after splash screen. It's working on other devices running older android though.
     
  20. thoorne

    thoorne

    Joined:
    Jul 22, 2012
    Posts:
    64
    From my experience this issue was fixed in 4.6.3.
     
  21. jtbentley

    jtbentley

    Joined:
    Jun 30, 2009
    Posts:
    1,397
    Turns out for us it was an issue with a 3rd party plugin, the builds ran fine once disabled.
     
  22. MagicBen

    MagicBen

    Joined:
    May 21, 2014
    Posts:
    2
    Hello,

    any news on this subject?
    Is it really fixed in 4.6.3+?
     
  23. MagicBen

    MagicBen

    Joined:
    May 21, 2014
    Posts:
    2