9

I have two Galaxy Nexus phones. The phones are the same firmware version 4.0.2, same build number, same kernel version. When I deploy the same exact app to both of the phones using Eclipse, I see different behaviors from each.

On one phone, everything works as expected. On the other phone, the main Activity crashes when switching to another activity and back to the main one, both by back button and by other activities finishing and returning to the activity that created it. The only clue I have to this problem is this error:

04-18 17:43:30.811: I/ActivityManager(207): Displayed org.mitre.Mobile/.Activities.QueryActivity: +430ms
04-18 17:43:30.819: I/n*.w*.w*.ZoomButtonsCo*(4962): invoke: onVisibilityChanged listener: org.osmdroid.views.MapView$MapViewZoomListener@4181ecd8
04-18 17:43:30.843: E/InputQueue-JNI(4962): channel '41d66628 Panel:org.mitre.Mobile/org.mitre.Mobile.Activities.MobileActivity (client)' ~ Publisher closed input channel or an error occurred.  events=0x8
04-18 17:43:30.843: W/WindowManager(207): Force-removing child win Window{41d66628 Panel:org.mitre.Mobile/org.mitre.Mobile.Activities.MobileActivity paused=false} from container Window{420815c8 org.mitre.Mobile/org.mitre.Mobile.Activities.MobileActivity paused=false}
04-18 17:43:30.850: W/WindowManager(207): Failed looking up window
04-18 17:43:30.850: W/WindowManager(207): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@41f9e658 does not exist
04-18 17:43:30.850: W/WindowManager(207):   at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7029)
04-18 17:43:30.850: W/WindowManager(207):   at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7020)
04-18 17:43:30.850: W/WindowManager(207):   at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2180)
04-18 17:43:30.850: W/WindowManager(207):   at com.android.server.wm.Session.remove(Session.java:149)
04-18 17:43:30.850: W/WindowManager(207):   at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:124)
04-18 17:43:30.850: W/WindowManager(207):   at com.android.server.wm.Session.onTransact(Session.java:111)
04-18 17:43:30.850: W/WindowManager(207):   at android.os.Binder.execTransact(Binder.java:338)
04-18 17:43:30.850: W/WindowManager(207):   at dalvik.system.NativeStart.run(Native Method)

I haven't really found anything useful on the internet related to this error message. I have some experience with android, but this one has really stumped me. I initially thought this was a nova launcher problem (the phone with the problem has it), but I installed nova on the other phone and still saw the same behaviors.

The phone with the app that doesn't work properly is my personal phone, the other is a work phone.

Manfred Moser
  • 29,539
  • 13
  • 92
  • 123
ejo4041
  • 225
  • 1
  • 4
  • 14
  • What is the main activity doing that is out of the ordinary? – CommonsWare Apr 18 '12 at 22:48
  • I perform the same activity on both phones, nothing out of the ordinary, drawing a mapping application and querying for data over a specified area. – ejo4041 Apr 18 '12 at 22:51
  • perhaps you have another customization on the phone rather than just the nova launcher, to test this you would have to reset the phone to the default state of course. – Raykud Apr 18 '12 at 22:59
  • I guess I could try that by backing up the nova launcher settings. I would really like to know the true culprit though, that way it can be fixed. – ejo4041 Apr 19 '12 at 00:55

2 Answers2

2

The issue happened to me after switching build variants. Something may be messed up with your build. Try restarting Android Studio, clean and rebuild. That solved the issue for me.

Good luck!

checkmate711
  • 3,301
  • 2
  • 35
  • 45
0

Just found out why every activity dies. In Settings > Developer Options, there is a check box called "Don't keep activities" "Destroy every activity as soon as the user leaves it". The box was checked. I just unchecked it. That explains everything.

ejo4041
  • 225
  • 1
  • 4
  • 14
  • 1
    This beggs the question what is the benefit of that developer option. Does turning it off mean that some instances where the activity might be killed (low on memory) remains untested and thus unaccounted for. – Andrew S May 01 '13 at 15:55
  • 9
    @AndrewS - it's important for your app to be robust under low memory conditions. Having that optioned enable simulates aggressive cleanup by the OS. – Mark Jul 09 '13 at 19:23
  • 1
    Yes, it's a very useful settings. It makes sure that your activities don't depend on each other. Never assume the activity below another one is alive. Don't rely on memory objects to resume states. Save data on permanent storage and UI state in bundles. – tdevaux Jan 26 '14 at 06:20
  • I have this problem on many different tablets that are running our proprietary kiosk software and allows the user to select a game (seperate downloaded apk) to play. Sometimes the game will open and close a few seconds later and show the error mentioned by the OP, and sometimes it will stay open and let the person play. That option was not checked in my settings. So, I don't think this is a comprehensive answer. – elliptic1 Oct 09 '15 at 18:50
  • 2
    @elliptic1 This answer explains why the OP's devices were behaving differently. But the underlying cause is that the app was doing things it shouldn't. You might not have that developer option checked but that doesn't mean that you're app isn't still doing things it shouldn't. If you're getting that error, it probably is. Please read tdevaux's comment and read into the subject a little more. – spaaarky21 Jan 06 '16 at 00:16