ajay
ajay

Reputation: 916

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.. !!!

Upvotes: 13

Views: 7781

Answers (3)

khemraj kashyap
khemraj kashyap

Reputation: 29

1). Go to the debugger and select view breakpoints

2).Make sure the All Breakpoint is unchecked.

enter image description here

Upvotes: 0

Amin Keshavarzian
Amin Keshavarzian

Reputation: 3963

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

Upvotes: 17

Robin Zhou
Robin Zhou

Reputation: 554

run app first, then press the "attach debugger to android process" button, it will open a choose process dialog, set the debugger from 'auto' to 'java'.

press this button

Upvotes: 36

Related Questions