My app has over 100k dau on Android (so a very high sample size) and I’m seeing a huge increase in crashes from devices running Android 4.4.2. The same device, the same application version, the only difference is the OS version- and the crash rate is literally 2-5x higher once the device upgrades to Android 4.4.2.
I’m already using 32 bit display buffer, not using multithreaded rendering or OpenGL 3.0, so those things are not the issue.
I see that NGUI has an Android 4.4.2 crash that might be the same thing (Crash occurs in kitkat (under opengl 2.0)) but I’m using 2D Toolkit (and some of the built in Unity 3d shaders + 3d meshes, Ragespline, lots of other home built stuff too), not NGUI, and no one else on the tk2d forums is reporting this so I thought I would post here first. The NGUI crash from that thread is related to resizing the number of verts in a VBO.
The NGUI thread mentions that the crash is inside of the PowerVR driver when it tries to do a memcpy, and memcpy is the reason for this crash here as well, so that’s why I think it might be the same thing.
Do OpenGL 3.0 build for those Adreno 320 and Adreno 330 devices.
or
Wait for new Unity release
or
Blacklist all devices with Adreno 320 or Adreno 330 GPUb
all my games are using NGUI, and I have a Note3.
all my builds are for OpenGL 2.0
never had any crashes in any of my games.
What I did find out once, was that NGUI 3.5.3 crashed on the device after like 1 minute of playtime.
This happened only on Android 4.4.2
What fixed the issue for me was to use NGUI 3.4.9
It is the most stable version for me and getting 0 crashes on any Android version.
I’m having the same issue. Lots of Samsung-based devices are crashing when using Android 4.4.2. In one game, it seems to crash instantly, but in others it can take a few minutes. I do a lot of mesh-resizing in my script, as the entire game engine is driven by that. I’ve downgraded to past versions of Unity (down to 4.1.5), used the 32-bit buffer fix, and nothing works.
What is an alternative to using a dynamically resizing mesh to do a massive amount of 2D drawing with a single texture (spritesheet)? I’m serious, as that’s the only way I’ve ever done it in Unity.
Try checking for NullReferenceException’s in the Console. Last year I noticed that when the Samsung S4’s came out, they would immediately crash when a NullReferenceException was encountered.
I had to play through the entire game in the Editor, waiting for these errors to happen. Then going into the scripts to fix the errors.
To fix these errors, just say something like:
if (Variable)
{
do something with Variable;
}
Instead of just saying “do something with Variable;” If the variable is null, then it will cause the crash in the S4. So you have to make sure the variable is not null before you do anything with it. Hope that helps!
Our game don’t work on any samsung tablet with android 4.4.2. There are crashes, and nullreferenceexcepition.
In stacktrace we have path of code that is no able to execute. In some getter, execution of code jumps to setter that is no there. It looks like something changes adresses on stack. We can avoid this behaviours by removing virtual/override methods/properties in places causing these errors but we can’t do it in whole project.
Also game works well on iPads, iPhones and variety of android devices.
We have also problems with Xperia z2 and OnePlus One. They are crashing when loading scenes or loading asset bundles with heapcoruption error.
This seems to be the exact issue I have been encountering as well. I tracked down the issue to this code
ShadowTag RegisterObject(int classId, IShadowable obj)
{
ShadowTag tag = new ShadowTag(obj, classId, NULL_ID, 0);
int objectId = m_objectList.Add(tag);
tag.ObjectId = objectId;
obj.SYS_Tag = tag;
if (tag == null)
throw new Exception1();
if (obj.SYS_Tag == null)
throw new Exception2();
return tag;
}
Where Exception2 keeps firing.
Meaning the “obj.SYS_Tag = tag” assignment a couple of lines above seem to be failing and SYS_Tag is a property on a interface (and the implementation just stores the value).
We have had similar symptoms when testing Android built with Unity 4.5.5. In a fairly reproducible case (~75%) our game will crash with Fatal signal 11 (SIGSEGV) having first logged an error from Unity. The Unity stacktrace shows a code path that should not (cannot) happen. Static analysis finds no call from one method in the stacktrace to the next. As @zibizz1 says, it’s as though the code/stack has been altered on device.
Here is a list of the devices we have tested on:
Crashed
HTC One M8 (Android 4.4.4)
Google Nexus 5 (Android 4.4.4)
Did not crash
Kindle Fire (2nd Gen)
Kindle Fire HDX 8.9 (3rd Gen) (Fire OS 4.5.1)
Samsung Galaxy S3 (Android 4.3)
Samsung Galaxy Note 2 (Android 4.3)
Samsung Galaxy Note 8.0 (Android 4.4.2)
Xiaomi Redmi Note (Android 4.2.2)
We will investigate @Unarmed1000 's interface idea and report back. We’ll also be testing on some more devices in the next few days so I’ll update with more info.
As yet we’ve not been able to distil the problem into a 100% reproducible test project.
We’ve since tested on Samsung Galaxy S5 (Android 4.4.2) and the Nexus 5 (4.4.4). They both crash.
We have noticed that switching runtime from Dalvik to ART stops the problem BUT upgrading the Nexus 5 to Android 5.0.1 (which has ART enabled by default) makes the crash occur more frequently.
LG G3
switching to ART stops the problem @cgJames on most Nexus devices with Android 5 every NullReferenceException is crashing game. It was apparently solved in 4.6.1p4
There seem to be a lot of NullReferenceException reports, some with SIGSEGV. The one I refer to is where Unity/Mono executes code that should not be called and subsequently crashes. I submitted a bug report (655263) and Unity QA have been able to reproduce. It’s been forwarded to the dev team.