java - Sudden app shutdown without doing any activity, throws IllegalStateException onMeasure() -


my app always shutdown in random time interval (mostly few minutes 20 mins). "app stopped working" messagebox appears. biggest problem is, don't in app (like interacting it), , random shutdown itself. here's logcat print:

07-15 20:34:16.595 27361-27363/test.game d/dalvikvm: gc_concurrent freed 141 9k, 44% free 13902k/24391k, paused 4ms+9ms, total 66ms 07-15 20:34:28.997 27361-27363/test.game d/dalvikvm: gc_concurrent freed 1416k, 43% free 13903k/24391k, paused 3ms+7ms, total 56ms 07-15 20:34:29.418 27361-27361/test.game d/androidruntime: shutting down vm 07-15 20:34:29.418 27361-27361/test.game w/dalvikvm: threadid=1: thread exiting uncaught exception (group=0x412b52a0) 07-15 20:34:29.498 27361-27361/test.game e/androidruntime: fatal exception: main java.lang.illegalstateexception: onmeasure() did not set measured dimension calling setmeasureddimension() @ android.view.view.measure(view.java:15293) @ android.widget.relativelayout.measurechildhorizontal(relativelayout.java:617) @ android.widget.relativelayout.onmeasure(relativelayout.java:399) @ android.view.view.measure(view.java:15288) @ android.widget.relativelayout.measurechildhorizontal(relativelayout.java:617) @ android.widget.relativelayout.onmeasure(relativelayout.java:399) @ android.view.view.measure(view.java:15288) @ android.view.viewgroup.measurechildwithmargins(viewgroup.java:4876) @ android.widget.framelayout.onmeasure(framelayout.java:310) @ android.view.view.measure(view.java:15288) @ android.view.viewgroup.measurechildwithmargins(viewgroup.java:4876) @ android.widget.linearlayout.measurechildbeforelayout(linearlayout.java:1396) @ android.widget.linearlayout.measurevertical(linearlayout.java:681) @ android.widget.linearlayout.onmeasure(linearlayout.java:574) @ android.view.view.measure(view.java:15288) @ android.view.viewgroup.measurechildwithmargins(viewgroup.java:4876) @ android.widget.framelayout.onmeasure(framelayout.java:310) @ com.android.internal.policy.impl.phonewindow$decorview.onmeasure(phonewindow.java:2397) @ android.view.view.measure(view.java:15288) @ android.view.viewrootimpl.performmeasure(viewrootimpl.java:1974) @ android.view.viewrootimpl.measurehierarchy(viewrootimpl.java:1217) @ android.view.viewrootimpl.performtraversals(viewrootimpl.java:1390) @ android.view.viewrootimpl.dotraversal(viewrootimpl.java:1113) @ android.view.viewrootimpl$traversalrunnable.run(viewrootimpl.java:4481) @ android.view.choreographer$callbackrecord.run(choreographer.java:725) @ android.view.choreographer.docallbacks(choreographer.java:555) @ android.view.choreographer.doframe(choreographer.java:525) @ android.view.choreographer$framedisplayeventreceiver.run(choreographer.java:711) @ android.os.handler.handlecallback(handler.java:615) @ android.os.handler.dispatchmessage(handler.java:92) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main(activitythread.java:4867) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:511) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1007) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:774) @ dalvik.system.nativestart.main(native method) 

one say, it's because didn't write setmeasureddimension() when overriding method onmeasure(). also, docs have write line onmeasure, otherwise illegalstateexception thrown (see here).

but don't overriding onmeasure anywhere in whole project, problem not here (at least not on side in case).

few things note:

  • this full logcat log, , of these lines ("at android. ...") doesn't link code, goes source - means of these links gray
  • this exception happens on s3 mini (android 4.1.2), never happened on old galaxy ace s5830i (android 2.3.6) (and yes, tested alot - on 20hours on old phone , app still running!).
  • never happened in emulator
  • there no "view resizing" operations running in background, cause exception

i post code, have absolutely no idea exception thrown.

if can help, i'd really, grateful. i'm lost @ point...

since there not code, random guess. can start looking out activities in you've added fragments. might activity containing fragment has been destroyed on device due inactivity long time(and memory requirements system, think reason finding bug on device , not on other). case fragment might referring view might not attached window now. (you can views use fragment adapters viewpager, etc if have used them).


Comments