Failed to set breakpoints in Android Studio

I am working on Ubuntu 14.04, AndroidStudio is 1.2.1.1. I can create an application, click the Debug icon and launch the application. I can see the logcat output and I can pause the application from the debugger. The only thing I cannot do is set a breakpoint. I have tried clearing the cache by restarting AS by right clicking on the file where I want to set a breakpoint. None of these give the desired effect. This is a well hidden feature.

+3


source to share


2 answers


There should be no problem setting breakpoints if you follow the described process here

If you run into some problems, follow these steps: - Use Log.d () in your application and see if it will output to logs. If you are not, you know you are not in debug mode. - Are you debugging a device or emulator? If a device, you need to enable development. I would suggest choosing "wait for debugger" to make sure it is connected before running the code.



It should be pretty simple. Let me know what you find out.

+1


source


I also had this problem in Android Studio where I could not set breakpoints. This is what I was doing wrong: I clicked on a line that had no code, or a line that contained a comment. As soon as I clicked on the line in the method / class, it allowed me to set a breakpoint.



+1


source







All Articles