Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio debugger taking too long to start/load

I had recently intalled NDK and had worked on jni for some time. I am again now shifted to my normal Android work but now when I am applying a debugger, the debugger is taking too much time to load. It loads many so files and all which are required to debug native code/ jni related stuff. I want to disable this so that debugger knows that I do not wnt to debug any cpp files. I am using Android studio 2.2.2 and I have tried setting "Debug type" of debugger to "Java" from "Edit Configurations" but it did not helped me. It stills loads the LLDB server and related so files while stating debugger.

Any help would be really appreciated.. !!!

like image 955
ajay Avatar asked Oct 25 '16 06:10

ajay


People also ask

Why is my debugger not working in Android Studio?

Debugger Isn't Working: Disconnected or Client not ready yetThis is usually a signal that the emulator instance is not properly connected with ADB and Android Studio. There are a few steps to try: First, try uninstalling the app from within the emulator and then restarting the emulator completely.

Why are method breakpoints slow?

Method breakpoints will slow down debugger a lot because of the JVM design, they are expensive to evaluate. Remove method breakpoints and consider using the regular line breakpoints. To verify that you don't have any method breakpoints open .

Is waiting for the debugger to attach Android studio?

If it is stuck waiting for a debugger means it is not attached to the app. You have to manually attach by clicking on Attach Debugger to Android process. It is on the right side of the run icon.


1 Answers

Its probably because you have introduced C++ native libraries in your App, to only debug java, click Run > Edit Configurations and then in the debugger tab, change Debug Type to Java

According to docs:

Because different debugger tools are required to debug Java/Kotlin code and C/C++ code, the Android Studio debugger allows you to select which debugger type to use. By default, Android Studio decides which debugger to use based on which languages it detects in your project (with the Auto debugger type)

The debug types available include the following:

Auto

automatically choose the best option for the code you are debugging. For example, if you have any C or C++ code in your project, Android Studio automatically uses the Dual debug type. Otherwise, Android Studio uses the Java debug type.

Java

Select this debug type if you want to debug only code written in Java or Kotlin—the Java debugger ignores any breakpoints or watches you set in your native code.

Native (available only with C/C++ code)

Select this debug type if you want to use only LLDB to debug your code. When using this debug type, the Java debugger session view is not available. By default, LLDB inspects only your native code and ignores breakpoints in your Java code. If you want to also debug your Java code, you should switch to either the Auto or Dual debug type.Select this debug type if you want Android Studio to

like image 186
Amin Keshavarzian Avatar answered Oct 14 '22 20:10

Amin Keshavarzian