Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Unity 4.6 and Lollipop - uGui PlayerPrefs error

Discussion in 'Android' started by Droidspirit, Dec 2, 2014.

  1. Droidspirit

    Droidspirit

    Joined:
    Aug 16, 2014
    Posts:
    43
    Hello,

    i think i found a very large bug on unity 4.6 final release:

    1. Create a c#-Script with a Toggle-Method. The Toggle-Method contains the following code:

    Code (csharp):
    1.  
    2. public void Toggle(){
    3.  
    4.     int prefValue = PlayerPrefs.GetInt ("test", 0);
    5.  
    6.     if (prefValue == 0) {
    7.         prefValue = 1;
    8.     } else {
    9.         prefValue = 0;
    10.     }
    11.  
    12.     PlayerPrefs.SetInt ("test", prefValue);
    13.     PlayerPrefs.Save ();
    14. }
    15.  
    2. Add Toggle-Script as a Component to the Camera (or something else)
    3. Create a uGui-Button. The OnClick() calls the Toggle-Method.
    4. Run the apk on a Lollipop-Device

    Then, after multiple clicks on the button, the app will be crash.

    Please see the testproject in attachment.

    Best regards
     

    Attached Files:

    MOSTY likes this.
  2. MOSTY

    MOSTY

    Joined:
    Sep 6, 2013
    Posts:
    266
    Same problem here. Please help.
     
  3. Droidspirit

    Droidspirit

    Joined:
    Aug 16, 2014
    Posts:
    43
    Here a stacktrace

    Code (csharp):
    1.  
    2.  
    3. java.lang.Error: FATAL EXCEPTION [UnityMain]
    4. Unity version : 4.6.0f3
    5. Device model : LGE Nexus 4
    6. Device fingerprint: google/occam/mako:5.0/LRX21T/1576899:user/release-keys
    7.  
    8. Caused by: java.lang.Error: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000009
    9. Build fingerprint: 'google/occam/mako:5.0/LRX21T/1576899:user/release-keys'
    10. Revision: '11'
    11. pid: 12259, tid: 12288, name: UnityMain >>> de.chickenpou <<<
    12. r0 b8dbc690 r1 b8e034e0 r2 b807e8d0 r3 00000001
    13. r4 b7f81ca0 r5 06c09b34 r6 00000001 r7 b7f81ca4
    14. r8 b899e000 r9 00000000 sl b7f81ca8 fp 00000000
    15. ip b6f5e72c sp a3a2a788 lr a3ae7ea0 pc a4335d50 cpsr 6573753a
    16.  
    17. at libunity.0090ad50(Native Method)
    18. at libunity.000bce9c(Native Method)
    19. at libunity.000ba204(Native Method)
    20. at libunity.003b2e48(Native Method)
    21. at libunity.00184854(Native Method)
    22. at libunity.001846d8(Native Method)
    23. at libunity.002194f8(Native Method)
    24. at libunity.00440830(Native Method)
    25. at libunity.004409b4(Native Method)
    26. at libunity.0044256c(Native Method)
    27. at libunity.00442898(Native Method)
    28. at libunity.0029f2e8(Native Method)
    29. at libunity.002a02ec(Native Method)
    30. at libunity.003c8a50(Native Method)
    31. at libunity.003d1e38(Native Method)
    32. at data@app@de.003ec7d3(Native Method)
    33.  
     
  4. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    Doesn't seem to have anything to do with PlayerPrefs. I think that is just a coincidence. Could you please file a bug on this issue? To workaround the problem you may want to try switching to OpenGL ES 2.0 as the target graphics API.
     
    Droidspirit likes this.
  5. Droidspirit

    Droidspirit

    Joined:
    Aug 16, 2014
    Posts:
    43
    Hi bitter,

    thank your for your reply.

    Switching to OpenGL ES 2.0 as target graphics APi works fine.

    I will report the issue.
     
  6. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Can you comment when this will be fixed, not a direct rant towars yourself, but the day Automatic and OpenGL Es 3.0 was added, the day customer report issues on Android and all BlackBerry platforms.. When is unity going to get OpenGL Es 3.0 right for once? Issues been reported throughout many major releases..Right now I left the value on automatic and simply scares me to do this in the future! only platform I can trust is iOS.. please can we figure out root of these problems once and for all.. Thank you
     
  7. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    It's not so much about getting it 'right' as working around driver bugs. The ES 3.0 drivers are still not entirely stable. At the same time not that many users are choosing ES 3.0 as the target graphics level. Because of this it takes longer for us to find all the driver problems and create workarounds for them. The best thing you as a user can do is to turn on ES 3.0 support and then file bug reports including repro steps and a detailed description of the device and android os version.
     
  8. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Cool, fair point I guess, think many users do not understand this setting and left ES2.0 on by default in the build settings in 4.6p1 I see default will be Automatic, therefore I;m sure going forward there will be more reports of issues related to ES 3.0 etc.
     
  9. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Has this bug been fixed?
     
  10. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    It's been fixed but didn't make it for p1 - I guess it will be part of p2
     
  11. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
  12. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712