- Home /
The question is answered, right answer was accepted
Android app crashes on launch
Hello, my app crashes on launch. I tried removing everything from the scene but it still crashes.
This only happens on one of my Android devices. link textRuns fine on the others.
I ran adb logcat and I get the attached log file.
The last thing reported before the crash is:
ANativeWindow: (1440/2560) RequestedResolution: (0/0) EGLSurface: (1440/2560) [EGL] Unable to acquire context: EGL_BAD_MATCH: Arguments are inconsistent (for example, a valid context requires buffers not supplied by a valid surface). (Filename: ./Runtime/GfxDevice/egl/WindowContextEGL.cpp Line: 250)
When I search the web it says this should be fixed. My version of Unity is 5.4.0f3
Thanks, --Mike
Answer by Zynpo · Oct 01, 2016 at 03:11 AM
I found the source of the crash.
We checked "Protect Graphics Memory" in Player Settings.
On some Androids this is not supported so the app just crashes.
This was extremely hard to narrow down!!
See: https://docs.unity3d.com/ScriptReference/PlayerSettings-protectGraphicsMemory.html
Oh my god, this solved my problem too. As of this morning none of my builds would run on my Nexus 5x. Works on some other phones. I spent most of my day figuring this out and almost gave up. Found this post and tried unchecking "Protect Graphics $$anonymous$$emory". Issue fixed! :)
It was just above version number which is something I changed today. I must have clicked on it accidentally.
Had the same issue with several Android Devices, and this solved our issue. Thank you!
How can I uncheck this? I have searched everywhere but I am running Unity 5.3.5 and I can't find this option anywhere. I am 99% sure this is what is causing my app to crash on startup but I can't find "protect Graphics $$anonymous$$emory" anywhere in player settings and it is not on the Unity documentation page.
Does anyone know how to set this to false?
Hey Brozef, did you ever figure this out? I'm using 5.3.5f1 trying to support a game that was built with that version and i have the same problem. So far only reported on the Google Pixel XL. I don't have that setting either in 5.3.5 :(.
Answer by binodlamagr · Jan 31, 2019 at 10:51 AM
This may not be related but here is my experience on same issue and how I SOLVED it.
While working on my game, I deleted Facebook SDK from my game because I couldn't make FB.AppRequest function work on my game. My game was building and working just fine before I deleted FB SDK but soon after that my app crashed on launch even before the splash screen. Using ABD tool, I found that my apk is still looking for some facebook related assets or things.
So I started looking for anything that still looks for facebook sdk assets and found facebook related code on androidManifest.xml at Assets>Plugins>Android. Once I deleted the code, my app ran just fine on my device.
Hope this will be of any help.
Thanks
Answer by Musicapparatus · Oct 01, 2016 at 09:11 AM
Did you upgrade this project from an earlier version by chance? It looks like the upgrade tool sometimes strips out sharers and makes them return null.
Hey @$$anonymous$$usicapparatus , can you please explain your answer a bit further? I upgraded from Unity 5.6.0 to Unity 5.6.2 and what happens is when I run the .apk file of my project on Android (Huawei P7 lite), it runs the first scene (intro video of my app) and then the app crashes. $$anonymous$$aybe it's related with Unity version upgrade, so how can I solve the issue of stripped out shaders?
Yes I upgraded the game to some version . And the game crashes . So what I did is to downgrade the project to the version which I used originally to build this game . Thanks man