2

How can I debug an Android app to find out which line is not correct?

Noted that I'm using Android Studio. Also I've done every things exactly the same as what my master did. It works for him as well but it doesn't for me. I mean it closes the app and throws "has stopped" error. Ok well, what's wrong?

4
  • Is your logcat showing any exceptions? Commented Jul 18, 2016 at 23:31
  • @FishStix Just after that I click on a Button. It show me several red lines. before that , nothing. I cant find which line has problem . Commented Jul 18, 2016 at 23:35
  • Put a break point on the click listener attached to that button and run the app in AndroidStudio in debug mode. Moving forward, please include more information (e.g. the click listener's code, logcat print statements, exceptions, etc...) Commented Jul 18, 2016 at 23:37
  • @FishStix I have problems whit break point. How can I put a break point and run in debugging mode ? Commented Jul 18, 2016 at 23:44

1 Answer 1

1

You can put breakpoints via Run -> View Breakpoints.

The Breakpoints dialog appears. In the left pane, scroll to the bottom. Select Any exception under Java Exception Breakpoints With Any exception selected, on the right pane, configure as follows:

Suspend: checked All: selected Condition: !(this instanceof java.lang.ClassNotFoundException) Notifications: both Caught exception and Uncaught exception selected 

You can refer this for better understanding.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.