There is currently a severe crash issue when building Unity game for Windows Phone 8 target. This can be easily reproduced with any project (empty project works for couple pause/resume cycles) by pressing home button on Windows Phone device and then back button, which should resume the application, but instead the application crashes. This has been present in all versions of Unity at least since 5.2.0.
This has also been reported at:
And multiple other places, but the crash still occurs even with the latest version.
This is rather huge issue for us, as we can’t update our game for our 20 million players. Crash also happens when for example entering in-app purchase, because that will also pause the game and try to resume it after the purchase.
Would be very nice to get this fixed before Windows Phone 8 support is deprecated.
That particular case was fixed in 5.2… if it’s still crashing, it may be possible it’s another failure. If you want for this to get fixed, please report a bug with detailed steps and with repro project attached. Cheers
We have tested all 5.2 releases and it was broken on each one of them. Latest version, where it’s working is old Unity 5.1 release, but it doesn’t support the Unet features we need. All you need to reproduce it, is any default Unity sample with some content in it, run it on Windows Phone 8, press home and then back and the application crashes instead of regaining focus.
Does it crash on an empty project, or on your project? You did not attach any project to your bug report. (P. S. don’t post full links to your bug report, you’ll leak your private info).
It does crash also on empty project, but that needs multiple pause/resume cycles. Any project with content will crash. You can use the steps in the public issue tracker to reproduce, it uses the standard unity asset project.
Thanks for the answer. Unity stuff claim, that they fixed this in 5.2.0, however I am not sure about it. I use only 2d sprites in my project and when I remove Canvas menu in OnApplicationPause from scene and then reload it in OnResume, it seems to work fine. It is a dirty hook and should be fixed by Unity team, but I tried few dozens of pause/resume cycles and the app did not crash.
I did just try this with empty project, it crashed on ~7th pause resume cycle. I added one empty GameObject, it crashed on first pause/resume cycle. Maybe canvas is the only object you have and the scene becomes empty after you remove it?
Device was Lumia 1520 on Windows Phone 8.1 with Unity 5.2.1p4
And as you say, I also think Unity fixed the issue, but never actually shipped a version with the fix.
I have multiple game objects on scene (it’s a working 2d game actually). I only delete Canvas and reload it in onResume. Unity version is 5.2.3p2 and device is Lumia 925. I tried 20-30 pause/resume cycles and it seems fine. Also please notice, that I am testing it on Master VS Solution Configuration (not debug or release) and with debugger detached (I install the game and run it manually on the device). And that is because debugger seems to crash the app sometimes.
That is still just a hook solution and in general should be fixed by Unity team.
I updated to 5.2.3p3 and now I get the same behavior. I guess I assumed it being the same bug in the newer versions as it crashed with a simple test scene I had.
If I remove all text components before the application pauses, everything works fine on resume. So seems that your topic is more to the point.
Trying to fix this by removing Canvas before pausing just doesn’t seem to be a reliable fix, we still get crashes often when pausing and resuming the application. Could anyone from Unity look into this? Would be really nice to get the Windows Phone 8 builds to actually work correctly on the last Unity release where it’s available
I am having the same Canvas related issue. I have Unity 5.2.4f1 and tested on Lumia 1520 with 8.1
If I create an empty project with a Canvas and a single Button, when pressing home on the device and then resume, the app will crash.(using master config)
With a (simple) project that doesn`t use canvas it seems to work.