- Home /
2D Android crashs at start up without any log.
Hello guys, I know that this question may sound vague, but I'm desperate. So, if you could help me I would really appreciate it. So, this is the problem.
I'm doing a 2D game in Unity 4.5.1 targeting Android ICS 4.0 (API lv 14) and sometimes when the game starts (right after the Unity splash screen) it crashes. I only do two Resources.Load at start up, a Sprite and a Prefab (I can't put them as GameObjects at build-time because they are choose randomly).
After some research I though about an OutOfMemory and started to see the Internal Profiler looking for some error, but all seems fine to me.
Here some data:
Stats at Editor
And the Internal Profiling:
06-12 21:37:32.110: D/Unity(24706): ----------------------------------------
06-12 21:37:33.210: D/Unity(24706): Android Unity internal profiler stats:
06-12 21:37:33.210: D/Unity(24706): cpu-player> min: 3.3 max: 114.6 avg: 17.8
06-12 21:37:33.210: D/Unity(24706): cpu-ogles-drv> min: 0.2 max: 1.4 avg: 0.5
06-12 21:37:33.210: D/Unity(24706): cpu-present> min: 0.0 max: 1.0 avg: 0.1
06-12 21:37:33.210: D/Unity(24706): frametime> min: 3.7 max: 114.9 avg: 18.3
06-12 21:37:33.210: D/Unity(24706): draw-call #> min: 16 max: 18 avg: 16 | batched: 2
06-12 21:37:33.210: D/Unity(24706): tris #> min: 46 max: 48 avg: 46 | batched: 15
06-12 21:37:33.210: D/Unity(24706): verts #> min: 92 max: 96 avg: 93 | batched: 31
06-12 21:37:33.210: D/Unity(24706): player-detail> physx: 0.2 animation: 1.6 culling 0.0 skinning: 0.0 batching: 0.1 render: 11.1 fixed-update-count: 0 .. 1
06-12 21:37:33.210: D/Unity(24706): mono-scripts> update: 0.1 fixedUpdate: 0.2 coroutines: 0.0
06-12 21:37:33.210: D/Unity(24706): mono-memory> used heap: 266240 allocated heap: 266240 max number of collections: 0 collection total duration: 0.0
06-12 21:37:33.210: D/Unity(24706): ----------------------------------------
I looked the logcat too for some exception or OutOfMemory, but it is crystal clear. Someone can help me? Give me some advice? I'm pretty much lost here.
Thank you :)
If you build an empty project, do you get the same problem?
Strip down to an empty project. Put your components back in, one-by-one, until the game breaks. It may not tell you the exact problem, but it'll give you a much better lead than you have right now.
Personally, I'd suspect that your scripts or your assets are doing something unusual in the built player that they're not doing within the editor. That's hard to diagnose without a better idea of the assets involved.
I already did what you said and after I remove one of the animations (the heavier one) it works fine. So I focused on finding an error in that animation. The problem is, if I keep the animation and remove other elements, it crashes again. That's why I think of an OutOf$$anonymous$$emory or BufferOverFlow. I don't know if it help, but the profiler says that the GPU doesn't do anything. $$anonymous$$ay I'm pushing too much the CPU at load time?