Android game works in Unity SDK but doesn't work on device
After unity's update (5.4+) i can't make my game work in my smartphone... the game works into the SDK but when i build it and push it into the phone the game crashes on the startup (after loading screen). So I used logcat (logcat downside) to see what the problem was. Now i'm not using heavy teaxures (i just use 3 small textures xD) or other heavy stuff .... How can i fix this problem?
PS i noticed i have this problem in scenes where i use Canvas, maybe it is related but it's weird because i hadn't this problem before i updated unity :/
logcat :
08-11 12:12:16.217 1962 1976 I Unity : (Filename: C Line: 0)
08-11 12:12:16.217 1962 1976 I Unity :
08-11 12:12:27.384 1962 1976 D Unity : [EGL] SwapBuffers: Surface invalid
08-11 12:12:27.391 1962 1976 E Unity : [EGL] Failed to create window surface: EGL_BAD_ALLOC: EGL failed to allocate resources for the requested operation.
08-11 12:12:27.391 1962 1976 E Unity :
08-11 12:12:27.391 1962 1976 E Unity : (Filename: ./Runtime/GfxDevice/egl/WindowContextEGL.cpp Line: 136)
08-11 12:12:27.391 1962 1976 E Unity :
08-11 12:12:27.391 1962 1976 I Unity : Skipped rendering frame because GfxDevice is in invalid state (device lost)
08-11 12:12:27.391 1962 1976 I Unity :
08-11 12:12:27.391 1962 1976 I Unity : (Filename: ./Runtime/Misc/Player.cpp Line: 951)
08-11 12:12:27.391 1962 1976 I Unity :
08-11 12:12:27.393 1962 1976 E Unity : [EGL] Failed to create window surface: EGL_BAD_ALLOC: EGL failed to allocate resources for the requested operation.
08-11 12:12:27.393 1962 1976 E Unity :
08-11 12:12:27.393 1962 1976 E Unity : (Filename: ./Runtime/GfxDevice/egl/WindowContextEGL.cpp Line: 136)
08-11 12:12:27.393 1962 1976 E Unity :
08-11 12:12:27.393 1962 1976 I Unity : Skipped rendering frame because GfxDevice is in invalid state (device lost)
08-11 12:12:27.393 1962 1976 I Unity :
08-11 12:12:27.393 1962 1976 I Unity : (Filename: ./Runtime/Misc/Player.cpp Line: 951)
what rendering settings are you using ? also are you using multithreaded rendering? You can view all settings under Player Settings -> Other Settings
$$anonymous$$y Setting is following image and I'm using 5.4.1f1.
Answer by xenophy · Sep 14, 2016 at 02:07 PM
Hi @robin994.
Do you had with the Android Plugin? I also the same problem has occurred.
When your native code generate IntentReceiver(ComponentName) you should add the "receiver" settings to AndroidManifest.xml in Plugins dir.
<receiver android:name="YOUR_BUILD_IDENTIFER.MyReceiver">
<intent-filter>
your actions here.
</intent-filter>
</receiver>
I hope this will help.
Your answer
Follow this Question
Related Questions
Is there a way to stop collecting device IDs in Android builds? 0 Answers
How do I stop Unity Editor from crashing on startup? "Unity Editor is not working" 0 Answers
Unity 5.4.0b11. Crashes on startup at Android 4.2.2 (target 17) 1 Answer
Why does my splash screen freeze after the logo displays? 0 Answers