Why Application.Quit Make Nexus 4 Crash?

I use Application.Quit() in my code for quit from game.
But, after i debug it in Nexus 4 and try the function. It will make my phone crash and I need to reboot the OS.
I already try it in Nexus 7 and Galaxy S3, and there is no problem with it.

Does it happened to anyone else?
or maybe someone could show me how to fix it?

We have a user with a Nexus 4 that has reported the same problem that you mentioned on our live android game. Unfortunately, we don’t have a Nexus 4 to debug it. We don’t have this issue on other devices such as Galaxy S2, S3, Sony Xperia Z, etc

We are using Unity 4.1.2f1.

Any clues in the debug logs? Does it crash 100% of the times?

Me too,i’m using Unity 4.1.2f1.
Yup,it crash 100%, and the log was suddenly stop too.

For now I found an alternative way to avoid OS crash by changing Application.Quit with:
System.Diagnostics.Process.GetCurrentProcess().Kill();
The only problem is, it only kill the app process and not the app itself.

Maybe later I will try using newer version of unity and hopefully it was unity bug.

+1 - Same here on Nexus 4! Seems to be a Unity3d thingy on Nexus 4…

“played 10 levels then tried to exit using the X as per game… it crashed my phone and a reset was needed. good game but needs fixing” [link]

“Looking good but crashes. Nexus 4. Froze my phone on quit.” [link]

You could submit a bug report with your project or try to reproduce the bug on a simple project and send them that. I would do it, but unfortunately don’t have a Nexus 4 to test a simple project on it.

Please keep us posted about your results! :wink:

Have a look here:

I submitted a bug report case 551563 to Unity 2 weeks ago but no response. We can’t take the chance to upgrade to 4.2 right now but I wonder if it’s fixed in the latest release.

What I think is happening: Android OS is loading your app as a background process even though it gives the user the impression the app is switched off * and maybe this causes problems in the background with the Unity app.

still an issue in 4.2, I submitted a simple bug report and they’re assigning it to a dev

Me too. Application.Quit() was working perfectly on 2 unity releases back but now it doesn’t work. Unity ver. 4.3.3f1

Sorry, my fault. Everything works fine :slight_smile: