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 5.3.1 Android PlayerPrefs crash

Discussion in 'Android' started by OnTopStudios, Jan 18, 2016.

  1. OnTopStudios

    OnTopStudios

    Joined:
    Aug 19, 2013
    Posts:
    44
    Hi,

    We recently updated Unity from 5.2.2 to 5.3.1 and our project crashes just after opening the game on Android.
    On Adb we get the following error:

    I/Unity (15243): splash_mode = 0 (integer)
    I/Unity (15243): useObb = False (bool)
    I/Unity (15243): Choreographer available: Enabling VSYNC timing
    I/Unity (15243): onResume
    I/Unity (15243): onPause
    I/Unity (15243): windowFocusChanged: true
    I/Unity (15243): onResume
    I/Unity (15243): Upgrading PlayerPrefs storage
    I/Unity (15243):
    I/Unity (15243): (Filename: ./PlatformDependent/AndroidPlayer/Source/PlayerPrefs.cpp Line: 133)

    After further google research, I came up with the following links and the solution given is to revert Unity to the old version (not a good solution for our project):

    http://answers.unity3d.com/questions/1123144/unity5-updated-game-crashes-upgrading-playerprefs.html
    http://stackoverflow.com/questions/...crash-on-update-upgrading-playerprefs-storage

    Does anyone solve this problem? Can a Unity developer gives us a hint how we can counter this?

    Cheers
     
  2. McTomas

    McTomas

    Joined:
    Jan 6, 2014
    Posts:
    8
    I also got this error on my project after updating to Unity 5.3.1p3
     
  3. OnTopStudios

    OnTopStudios

    Joined:
    Aug 19, 2013
    Posts:
    44
    Does anyone else have this problem? Is there a solution to fix this?
     
  4. grosssmutttr

    grosssmutttr

    Joined:
    Apr 15, 2014
    Posts:
    168
  5. skaarjslayer

    skaarjslayer

    Joined:
    Oct 10, 2013
    Posts:
    108
    We're running into the same issue. A build originally published with Unity 5.2.x was upgraded with a new build on Android with Unity 5.3.x. Users who upgraded got black screens on application launch. If they deleted the app from their device and freshly downloaded the 5.3.x build from the store, the build would work fine.

    A second problem we noticed was that when we uploaded a reverted build using 5.2.x in order to mitigate damage, users who had gotten the black screen issue from the 5.3.x update and had deleted the app, reinstalled from the store to get a working game, had their progress lost, and restarted progress... would get the reverted 5.2.x corrective update and lose that second progress all over again (but this time without the black screen issue).

    The black screen occurred when these errors were being thrown in logcat:

    ----------

    I/Unity (14309): Upgrading PlayerPrefs storage
    I/Unity (14309): I/Unity (14309): (Filename: Line: 133)
    I/Unity (14309): D/CustomFrequencyManagerService( 852): releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT frequency : 1242000 uid : 1000 pid : 852 tag : ACTIVITY_RESUME_BOOSTER@9 E/dalvikvm(14309): JNI ERROR (app bug): local reference table overflow (max=512)
    W/dalvikvm(14309): JNI local reference table (0x63a3bb00) dump: W/dalvikvm(14309): Last 10 entries (of 512): W/dalvikvm(14309): 511: 0x4236f6f0 java.lang.String "0" W/dalvikvm(14309): 510: 0x4236f600 java.lang.String "SCORE_KEY_LOCAL_... (51 chars)
    W/dalvikvm(14309): 509: 0x42385a60 java.util.HashMap$HashMapEntry
    W/dalvikvm(14309): 508: 0x42393b28 java.lang.OutOfMemoryError W/dalvikvm(14309): 507: 0x42393d90 java.lang.String "java.lang.OutOfM... (62 chars)
    W/dalvikvm(14309): 506: 0x417f5890 java.lang.Class<java.lang.Object> W/dalvikvm(14309): 505: 0x42393b28 java.lang.OutOfMemoryError
    W/dalvikvm(14309): 504: 0x4236f5c0 java.lang.String "XltBXFtERlJFEVxX... (32871 chars)
    W/dalvikvm(14309): 503: 0x42316ad0 java.lang.String "MjZ2d34odWQ="
    W/dalvikvm(14309): 502: 0x42385a40 java.util.HashMap$HashMapEntry
    W/dalvikvm(14309): Summary: W/dalvikvm(14309): 22 of java.lang.Class (13 unique instances)
    W/dalvikvm(14309): 1 of java.lang.Object W/dalvikvm(14309): 1 of java.lang.Class[] (1 elements)
    W/dalvikvm(14309): 305 of java.lang.String (305 unique instances)
    W/dalvikvm(14309): 18 of java.lang.OutOfMemoryError (9 unique instances)
    W/dalvikvm(14309): 7 of java.lang.Integer (5 unique instances)
    W/dalvikvm(14309): 1 of java.util.HashMap W/dalvikvm(14309): 150 of java.util.HashMap$HashMapEntry (150 unique instances)
    W/dalvikvm(14309): 1 of java.util.HashMap$EntryIterator
    W/dalvikvm(14309): 1 of java.util.HashMap$EntrySet
    W/dalvikvm(14309): 2 of android.app.SharedPreferencesImpl (2 unique instances)
    W/dalvikvm(14309): 1 of android.app.SharedPreferencesImpl$EditorImpl W/dalvikvm(14309): 1 of com.unity3d.player.UnityPlayer
    W/dalvikvm(14309): 1 of $Proxy0 E/dalvikvm(14309): Failed adding to JNI local ref table (has 512 entries)
    I/dalvikvm(14309): "UnityMain" prio=5 tid=11 RUNNABLE I/dalvikvm(14309): | group="main" sCount=0 dsCount=0 obj=0x421e4008 self=0x5ca87d68
    I/dalvikvm(14309): | sysTid=14329 nice=0 sched=0/0 cgrp=apps handle=1554547136
    I/dalvikvm(14309): | state=R schedstat=( 0 0 0 ) utm=3 stm=1 core=1
    I/dalvikvm(14309): at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    I/dalvikvm(14309): at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    I/dalvikvm(14309): at com.unity3d.player.UnityPlayer.a((null):-1)
    I/dalvikvm(14309): at com.unity3d.player.UnityPlayer$b.run((null):-1)
    I/dalvikvm(14309): E/dalvikvm(14309): VM aborting E/CRASH (14309): signal 6 (SIGABRT), code -6 (?), fault addr --------
    E/CRASH (14309): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    E/CRASH (14309): Build fingerprint: 'samsung/d2vw/d2can:4.4.2/KOT49H/T999VVLUFNH2:user/release-keys'
    E/CRASH (14309): Revision: '16'
    E/CRASH (14309): pid: 14309, tid: 14329, name: Thread-6232 >>> com.ratrodstudio.snowparty2 <<<
    E/CRASH (14309): r0 00000000 r1 000037f9 r2 00000006 r3 00000000
    E/CRASH (14309): r4 00000006 r5 00000002 r6 000037f9 r7 0000010c
    E/CRASH (14309): r8 5ca87e10 r9 00000001 sl 63a409c4 fp 62d998e0
    E/CRASH (14309): ip 00000000 sp 62d99620 lr 4004818d pc 40057134 cpsr 554c5656
    E/CRASH (14309):
    E/CRASH (14309): backtrace:

    ----------

    It would appear that there is a severe issue with Unity 5.3.x upgrading playerprefs storage from previous Unity versions on Android.
     
    Last edited: Jan 20, 2016
  6. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Bug report please! With a project.
    Sounds like a serious issue. I'll take a look as soon as possible (when the bug is submitted).
     
  7. skaarjslayer

    skaarjslayer

    Joined:
    Oct 10, 2013
    Posts:
    108
    Already submitted a few days ago, case numbers are:


    Case 762733 - This is for the bug when a Unity 5.2.x build on Android gets upgraded with a Unity 5.3.x build and users get a black screen with PlayerPref errors.

    Case 762736 - This is for the bug when users who got the above error deleted their app, reinstalled from Google Play, game worked, started a new save, then got our corrective Unity 5.2.x build and lost all save data.
     
  8. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Thank you, I'll make sure they get enough attention.

    Please pay attention that you probably have to save something (huge?) to PlayerPrefs to reproduce the bug, before upgrading the app.
     
  9. renegadeshock1983

    renegadeshock1983

    Joined:
    Apr 5, 2014
    Posts:
    1
    Hello Guys,

    We are also facing this same issue please find the attached Crash Log.
    The bug is caused when we try to upgrade our Google Play live build with the latest unity version(5.3.0f1) build.
    NOTE: After upgrading the app crashes immediately after startup.

    We have checked on the forum and same issue has already been posted on the issue tracker

    Following is the link to the same :
    http://answers.unity3d.com/questions/1123144/unity5-updated-game-crashes-upgrading-playerprefs.html

    Following are the case numbers
    Case 762733
    Case 762736

    Kindly let us know what is the status on the same as this issue is blocking us from releasing an updated of our game.

    Thank you,
    Raviraj Vaidya.
     

    Attached Files:

  10. cgJames

    cgJames

    Joined:
    Dec 3, 2014
    Posts:
    30
    @Yury Habets I've also submitted a bug report (somehow I missed this post).

    The bug report is Case 764422. There is a repro project and APK that reproduce the problem 100% of the time, resulting in a process crash with Signal 6.

    The PlayerPrefs file is not huge, it's 39 KB on disk but I can confirm for smaller files the bug does not occur. I suspect (but haven't proven) that ~256 entries in PlayerPrefs will trigger the crash (since it seems both name/value strings per entry are now being URL Encoded and it's the process of processing each string that is causing the JNI Error).

    For those needing a quick fix we have a working theory that Unity is migrating the PlayerPrefs file and running out of memory due to some JNI interaction. The migration seems necessary for 5.3+ but you can intercept it and perform the upgrade yourself (URL encoding the name/value pairs and adding additional meta data). Note that the PlayerPrefs file is now saved with a new suffix: v2.playerprefs.xml

    If you perform those steps then Unity thinks the migration is not necessary and launches the game without crashing.

    As I said, this is just a theory; however, our fix is now in production and *so far* we've had no further reports of the game not launching.
     
  11. grosssmutttr

    grosssmutttr

    Joined:
    Apr 15, 2014
    Posts:
    168
    Anyone already tested Unity 5.3.2? Does it solve this issue?
     
  12. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    This is blocking us too.
    We're updating to 5.3.2 but we don't have any high hopes as it wasn't mentioned in the release notes.

    @JoshPeterson @Yury Habets We had spent several hours trying to reproduce it with a minimal project, but couldn't reproduce. However we can give you access to the google play beta to experience it. The bug report we had done several days ago is case number 764630 if you want to follow up on that. We have not received any confirmation that the bug occurs.

    We are blocked from releasing updates on android.
     
  13. grosssmutttr

    grosssmutttr

    Joined:
    Apr 15, 2014
    Posts:
    168
    Ok. I also don't have any hope because it is missing in the release notes. Would be nice if you could update me whether version 5.3.2 solved your problems with the PlayerPrefs.
     
  14. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
    @xenonmiii

    I won't be much help here, as this looks like it is not specifically related to IL2CPP. However, I'm sure that our QA team will have a look.
     
  15. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    @grosssmutttr Seems like 5.3.2 still doesn't solve the issue!
     
    Last edited: Jan 28, 2016
  16. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    @JoshPeterson Sorry for bothering you. Do you have any contact we could chase for this? Maybe they are already on it?

    Thanks
     
  17. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    @Yury Habets Where is the playerprefs saved on an android? We could send you the android playerprefs saved by 5.2, which crashes android when launching it with a 5.3 client, so Unity can then debug this issue.
     
  18. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @xenonmiii : I think the easy project repro is to save 256+ lines to playerprefs, and after that upgrade the game from 5.2 to 5.3.
    The fix is coming. Stay tuned!
     
  19. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
  20. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    @Yury Habets I see 5.3.2p1 patch has been released. Did you mean the fix is in that patch (no playerprefs mentioned in the release notes)
     
  21. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    @Yury Habets Any ETA for the patch which has this fix? Thanks
     
    grosssmutttr likes this.
  22. skaarjslayer

    skaarjslayer

    Joined:
    Oct 10, 2013
    Posts:
    108
    @xenonmiii They said a fix is coming soon. The point of this thread was to draw Unity's attention to it and make sure they know that it's a serious issue for us. Both of these things has been accomplished, so we should be patient.
     
  23. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    @SkaarjSlayer I think there's nothing wrong in asking for an ETA, especially since we're blocked from releasing an update to our customers and I have to give updates to my superiors when we can release an update to our customers/publisher. It isn't the first time I've seen the helpful chaps from Unity giving an ETA of the next patch.
     
  24. OnTopStudios

    OnTopStudios

    Joined:
    Aug 19, 2013
    Posts:
    44
    Althought it's nothing mentioned on the release notes, the last update 5.3.2p2 seems to solve the problem.

    Thanks u
     
    DarkCooker, Yury-Habets and xenonmiii like this.
  25. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    Yury-Habets likes this.
  26. grosssmutttr

    grosssmutttr

    Joined:
    Apr 15, 2014
    Posts:
    168
    Yes, confirmed. Version 5.3.2p2 fixed the problem.