- Home /
Unity Android app crashes on application quit
Hi, I'm working unity android app and implemented back key functionality. When use pressed back application should be closed, but my app crashes on that time.
ANR in com.. (com../com.unity3d.player.UnityPlayerProxyActivity)
Application is not responding: AppWindowToken{434e9b58 token=Token{42b69a18 ActivityRecord{42571750 u0 com..**/com.unity3d.player.UnityPlayerProxyActivity t17}}}. It has been 7520.0ms since event, 5005.6ms since wait started. Reason: Waiting because no window has focus but there is a focused application that may eventually add a window when it finishes starting up.
I've integrated google admob,google analytics, google play services, vungle, flurry,facebook in my app and soomla IAP.
Thanks.
Did you find a solution? $$anonymous$$y app also crashes at Application.Quit(). I also integrated google analytics, google play services and soomla-store.
Has anyone tried logging out of Google services first?
Answer by phuongdong008 · Jan 09, 2015 at 08:24 PM
In my case, the same problem happened after I integrated Admob plugin into Unity. If this is also your case, you can solve by going to the Plugin/Android/AndroidManifest.xml file and delete the entire UnityPlayerProxyActivity and then move the intent filter down under to the UnityPlayerActivity.
I have been searching all over for a solution... you were the only one that got it right! I just wonder what the implications of removing the Proxy Activity are... Great post!
PS.: I can't vote you up yet, I'm new around here.
Answer by anilthapliyal8024 · May 15, 2017 at 02:37 PM
Can use : System.Diagnostics.Process.GetCurrentProcess().Kill(); // instead of // Application.Quit();
Answer by CarlosP · Jan 19, 2015 at 09:34 AM
I've had this problem, and removing the ProxyActivity indeed makes it faster to quit. However, if you want to re-launch the app it will delay 4-5 seconds (until it times out and kills the window).
This error is caused by the Google Play Games plugin for Unity. We removed it and our game launches and quits as it should. That plugin ended up having several errors... We are moving to facebook's scores.
Hope it's useful for someone!
Answer by Nomibuilder · Jan 19, 2015 at 02:26 PM
I have updated my Unity Pro version from 4.5.2 f1 to Unity 4.6.1 And it solved my problem. Don't know the reason. I think it was the bug in Older version of unity while building it.
Answer by guybrush.threepwood · Feb 18, 2015 at 03:16 PM
EDIT: Found an answer: http://ux.stackexchange.com/a/7518
The answer is: you simply don't need to close applications manually on modern mobile operating systems
I can confirm that
"delete the entire UnityPlayerProxyActivity "
helps for quitting immediately, but I can also confirm that
"if you want to re-launch the app it will delay 4-5 seconds"
after that change.
I am using Unity 4.6.2f1 with latest admob plugin https://github.com/googleads/googleads-mobile-plugins
So we can assume that lib is broken? Or are we doing something wrong? I mean, why are we the only people with that problem?!
You're not alone. I have the same problem in Unity 5 without even using the admob.
FYI: Found a solution http://ux.stackexchange.com/a/7518 And I've also heared, that exit/quit actions lead to rejection by apple.