Android application that does not have debugging information in Android Studio

I am trying to debug an application that I am writing using Android Studio, but I cannot get any useful debugging information from Android Studio "Debug". I launch my application using the Debug icon with an error, but there is nothing useful in the Debug view (for example, stack frames from my application):

screenshot

Even if my application crashes, I do not receive any useful information. As far as I remember, the ADT plugin automatically deleted you along the line that caused the crash.

Do I need to do something to make the application "debugged" in Android Studio? I also tried to force android:debuggable="true" in my AndroidManifest.xml, but to no avail. Android Studio seems to join the running process (the application displays the message “attach to the debugger” for several seconds the first time it starts).

+7
android debugging android-studio
source share
2 answers

After updating Android Studio, this problem disappeared. I don’t know what the problem is.

0
source share

There are a few things to check:

  • If your application debugger is running and stops at regular breakpoints, you might need to set a breakpoint exception:
    • Open debugger
    • Click View Breakpoints
    • Typically, there should be a breakpoint called "Any Exception", with the checkboxes "Exception Corrected" and "Excluded Exception". If not, add the exception checkpoint yourself and specify the type of exceptions you want the debugger to stop (you can use wildcards in the names of the exception classes, for example, * Exception).
  • If your application debugger is not working, check the following options:

    • Check if USB debugging is enabled in your device’s settings.
    • Check if the computer is authorized as a development machine in the device’s developer settings (if you’re not sure, clear the authorization list from the developer’s settings page and reconnect the device).
    • Check if there is only one adb-server process running in your background running in your development machine (if more, kill all of them using the process manager and restart it using the "adb start-server")
    • Add "debuggable true" to your debug-buildType in the build.gradle file:

       buildTypes { debug { debuggable true } ... } 
  • If your application debugger still does not work, restart your computer and reinstall the adb drivers for your device. Make sure that conflicting drivers do not work with more than one connected device (perhaps only one connection at a time).

Note. Even if you use working exception points, they may not be useful at all, depending on the type of failure. In most cases, you can disable the debugger in the Zygote exception handler, where you won’t get a lot of useful information or a stacktrace. In such cases, the easiest way is to let the debugger resume or fail without a debugger and check the logcat-output for stacktrace for the ERROR error level of your application logarithm. These stacktraces must have interactive line information that allows you to set a normal breakpoint in the corresponding line of code in the application source code in order to analyze the problem.

+5
source share

All Articles