• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Debugging release

23tony

Well-Known Member
Mar 26, 2019
242
92
Raleigh, NC
I have a signed api and I just pushed an update to it. Still not play store. It works just fine on the emulators, but on my phone it keeps crashing. (Just A Map keeps stopping)

I changed very little since the last version: added an image for a splash screen background (it's a style background so it only shows during startup) and moved a few things around. The big change is the image, but it displays that just fine, and moves on to the next activity before it crashes.

How can I find out what is breaking?
 
How can I find out what is breaking?

You can setup breakpoints in AS. There's some good tutorials online on how to set them up. This will show you exactly where things break/crash.

You can also attach your phone to your pc and run the app on your phone from AS. As soon as the app crashes you will get the error in the logcat panel of AS.

This is why I keep phones around of different screen sizes and android versions to test my apps. I don't use the emulator because bad code sometimes runs on the emulator just fine.

Also each feature change should be in its' own VCS commit. It's easier to troubleshoot and revert when done this way. It's simply best practice.
 
  • Like
Reactions: Deleted User
Upvote 0
You can setup breakpoints in AS. There's some good tutorials online on how to set them up. This will show you exactly where things break/crash.

You can also attach your phone to your pc and run the app on your phone from AS. As soon as the app crashes you will get the error in the logcat panel of AS.

I think this was a DOH moment - I knew that!

Also each feature change should be in its' own VCS commit. It's easier to troubleshoot and revert when done this way. It's simply best practice.

Not completely sure what you mean - it's own VCS commit? I'm using git, and for this change, there were some (about 4) margin changes in one layout file, and the image. Pretty small changes - you think that's too much for one change? I can revert easily, but I'd rather figure out what's wrong here.
 
Upvote 0
Not completely sure what you mean - it's own VCS commit? I'm using git, and for this change, there were some (about 4) margin changes in one layout file, and the image. Pretty small changes - you think that's too much for one change? I can revert easily, but I'd rather figure out what's wrong here.

I meant a commit for each change. How you did it is fine.

Did you try reverting a little at a time till the crashing stops? Start with the margins since that's easier to revert(unless the margins are for the splash), but use a physical device for testing instead of the emulator. Just for now.

If it turns out to be the splash screen code, then perhaps I can post a sample from one of my apps for you to compare which might help.
 
Upvote 0
After debugging on my phone directly, i found it was completely unrelated to any changes I had made.

I had, for unrelated reasons, disabled location services. Permission was granted, but there was no location to get, and I wasn't handling the null object correctly!

So, even though an unrelated issue, it led me to a bug I didn't know I had. A fortunate accident.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones