Force Close when opening from Google Play

You must Login before you can answer or comment on any questions.

I have an Android app that, when opened directly from the store, force closes every single time. When opening through the usual means, it opens just fine. There were some old bugs related to this, but they were supposed to have been fixed in 1.6.x. I'm running 1.8.2.

Is anyone else seeing this? My Google Fu hasn't turned up much which leads me to believe that I may be doing something wrong, but I can't imagine what. Any idea what might be going on?

Thanks.

— asked 12 months ago by Rob Wilkerson
2 Comments
  • This seems like a big deal to me so I'd expect to be able to find info on this, but either I'm searching the wrong terms or there just isn't much out there. The latter strikes me as unexpected at the very least if this is a thing.

    — commented 12 months ago by Rob Wilkerson

  • If I view logcat, I see:

    • ANR in [my app] Reason: keyDispatchingTimeout
    • missing intent CATEGORY_LAUNCHER

    I have no idea whether either is relevant, but they're reported as errors, for whatever that's worth.

    — commented 12 months ago by Rob Wilkerson

1 Answer

When you say "force close", do you mean you're seeing the message "restart required"?

If so, see below. If that's not the issue, I apologize.

On Android, if a user installs your application and clicks the "open" button on the install dialog, your app will launch, and an alert dialog will pop up, saying "An application restart is required".

The android market app doesn't launch applications the same way as the home screen (Android bug 5277). Therefore, Android sees it as two different invocations of the app and you'll have multiple copies of your app running if you open it right after install, press home, and then launch the app again from the home screen.

Titanium's developers built in the restart dialog to guard against this possibility. But to the user, it does look like an error has occurred in your app, and this is the user's first experience with your app. Not good. In Titanium 2.0 you have some tools to deal with it.

— answered 12 months ago by Jason Priebe
answer permalink
5 Comments
  • This is great information, Jason. Thanks. What I actually see, though, is a dialog indicating that my app is not responding with options to Force Close or Wait. That said, I have a sense that some of this might still apply (although I'm not sure why I have that sense).

    What you're describing, if I remember correctly, is what I used to see when I installed the APK from a source other than the market.

    — commented 12 months ago by Rob Wilkerson

  • Gotcha. I hoped it would be the easier case.

    I think you're going to have to strip down your app to isolate the offending code. It can be a very time-consuming process, I know.

    I had to spend 6 hours once to find that you can't add a 'close' event listener during a window's 'open' event listener (on android -- of course, it works on iOS). D'oh.

    Good luck!

    — commented 12 months ago by Jason Priebe

  • I guess the thing that is hanging me up is that it only happens when launching from the market screen. Everything is peachy when launching from a home screen or the all apps drawer. To me, that screams, "not a code problem". Or maybe it is and I don't have a deep enough understanding of the differences in how Android launches app from one place vs. another.

    Thanks again.

    — commented 12 months ago by Rob Wilkerson

  • Show 2 more comments

Your Answer

Think you can help? Login to answer this question!