The operating system (windows)
I’ve seen a few threads on this error here on Unity forums and people were able to bring back working builds by rolling back to a previous system restore point. And after that there was some 5.5 patch version that solved the problem for them.
In my case rolling back won’t help much because Unity still spoils something in the registry along the way. And this will require constant rollbacks.
Unity usually tries to compile shaders on a target platform to see what’s supported and what is not. Shader errors on startup are almost expected (we’ve consulted Unity engineer on that)
– UPDATE
I took another computer as a build machine and built a project with a newly installed 2017.1.1p1 (the one we’ve been using this whole time) and its building ok, so it’s DEFINITELY something with the system.
I guess the only way around it is to keep a virtual machine with Windows on it and build via that virtual machine.
I will reinstall Windows on my main machine now and use this “clean VM” approach until 2017.2 is out, I hope they will have fixed something regarding this problem by that time
I see. When I updated Unity, it stopped crashing on some of the devices. Prior to updating, even Play Store was showing that my app would crash on Pixel 2. But that’s gone now. Still crashes on some devices.
@ercion I have some more data. How do you store players progress? Do you use PlayerPrefs?
It looks like on some devices the data in PlayerPrefs can become corrupted which leads to these things. I don’t know if it’s caused by our preferences or by something that Unity internally stores
It was crashing every time I’ve built a game on Android, even after I cleared all cache and registry things on my Windows machine. I even deleted Unity (to be reinstalled again later). But then I thought of why not to try reinstalling it completely clean, after deleting the app from the phone (so it wipes PlayerPrefs too). I have uninstalled the game, reinstalled from the same APK that was crashing 100% (I couldn’t physically build a new APK because I have just uninstalled Unity) and it started working OK without any issues.
I see. Maybe we should get the prefs xml out of the phone the next time the error shows up. Does your app crash on any emulator? That would be easier to root.
I have a rooted tablet and will try running a game on that
I’m also experiencing the same frickin crash on startup (the example above only crashes after the splash screen, not at the startup) on another phone where I don’t store any preferences in PlayerPrefs at all.
It’s also not a 100% crash but more like 5 out of 4 launches, sometimes it only starts on 8th try.
Maybe Unity tries to read something from Player Prefs right at the startup.
@ercion can you provide steps to copy on-device prefs xml? Also, which emulator can you advice to test on?
Hi there,
I was having a similar issue. My game runs fine on Galaxy S6 edge but fails on a Xiaomi Redmi Note 4G, running android 4.4.2. I’m also using PlayerPrefs.
After searching a little I ended up disabling the ‘Multithreaded Rendering’ flag in the android player settings. This has seemingly fixed the issue. Haven’t had a crash the last few times I’ve tried to open. Earlier it would crash 4 out of 5 times. The initial loading time seems a bit longer but overall the performance for my game isn’t majorly affected by this change. Wonder if this fixes any of the problems you guys have been having.
I was getting this error because some Android devices didn’t play well with the Terrain object. Btw simply removing the Terrain object from your scene isn’t enough. For some reason you need to rebuild your scene without a Terrain object. The easiest way to do this without having to start from scratch is…
Remove the Terrain object from your scene
Create a new GameObject and drag everything from your scene into that GameObject
Drag that GameObject over to your Assets folder to create a prefab
Create a new blank scene
Drag your GameObject prefab into that scene
Everything should work fine now
You might then say, well I need something like a Terrain object for my game. The workaround is to create a huge Plane object as the ground floor of your game, then add some mountain assets to it, like these nice mountains…
Anyway this Terrain bug in Unity looks like it will be fixed in an upcoming release…
Hi, we have a game on Production right now that crashes with this error on some phones.
Is that the accepted solution? @ercion@Kumo-Kairo ? did you try the solution of @slarti89 .
We cannot reproduce the error in house and the error is being reported back to us. It would be amazing to know it’s the solution before uploading an update.
I’ll keep investigating