Android Studio Cannot Debug C++ Code: Prompt Dual (Java + Native) (15971)(Disassembly)

Abstract: Resolve Android Studio C++ debugging failure by verifying CMakeLists.txt shared library settings, correcting ABI filters in build.gradle, and restarting the debug daemon.

Created: 2026-08-25 by

Android Studio displays the "Prompt Dual (Java + Native) (15971)(disassembly)" error when the debugger fails to attach properly to native C++ threads. This occurs because the IDE cannot synchronize the Java and Native debug sessions, forcing it into a disassembly view instead of showing source code. Resolving this requires verifying your CMakeLists.txt configuration, ensuring proper ABI filtering, and restarting the debug daemon to clear stale connection states.

Understanding the Debug Attachment Failure

When you attempt to debug an Android application that uses JNI (Java Native Interface), Android Studio launches two distinct debuggers: one for the Java/Kotlin layer and another for the native C++ layer using LLDB. The error message indicates that these two processes are failing to handshake correctly. Instead of stepping through your C++ source files, the debugger falls back to viewing raw machine instructions, which is useless for standard development workflows. This specific failure mode often happens during the initial launch phase. The system detects that the native library has loaded, but the symbol table required to map memory addresses to variable names and line numbers is either missing, corrupted, or mismatched between the build output and the running process. If you have recently refactored your project structure or changed compiler flags, the cached debug information may no longer align with the compiled binary.

Verifying CMake Configuration

The most common cause lies in how the native libraries are defined in your CMakeLists.txt file. You must ensure that the add_library command correctly specifies the type of library you are building. For debugging to work seamlessly, shared libraries (SHARED) are generally preferred over static libraries (STATIC) because they can be loaded and unloaded dynamically by the Android runtime. Check your build script for the following pattern:
add_library( # Sets the name of the library.
             native-lib

             # Sets the library as a shared library.
             SHARED

             # Provides a relative path to your source file(s).
             src/main/cpp/native-lib.cpp )
If you are using static libraries, ensure they are linked correctly via target_link_libraries. However, switching to shared libraries is the standard recommendation for resolving attachment issues. Additionally, verify that you are not stripping symbols from your release builds if you intend to debug those configurations, although this is rare in development environments.

Configuring ABI Filters Correctly

Android devices support multiple CPU architectures, including armeabi-v7a, arm64-v8a, x86, and x86_64. If your APK contains binaries for architectures that do not match the device you are testing on, or if the ABI filters are misconfigured in your build.gradle file, the debugger may fail to locate the correct native thread. Open your module-level build.gradle file and inspect the ndk block. Ensure that the abiFilters list includes only the architectures relevant to your target device. Over-filtering can result in an APK that lacks the necessary native code for the emulator or physical device, causing the debugger to hang or crash immediately upon launch.
android {
    defaultConfig {
        ndk {
            abiFilters 'armeabi-v7a', 'arm64-v8a'
        }
    }
}
If you are developing for emulators, remember that x86_64 emulators require the corresponding x86_64 native libraries. Mixing ARM libraries on an x86 emulator will lead to immediate crashes or silent failures in the debugger attachment process.

Restarting the Debug Daemon

Sometimes, the issue is not with the code but with the state of the Android Debug Bridge (ADB) or the LLDB server itself. Stale connections can persist even after you stop a run configuration. To resolve this, open the Terminal window in Android Studio and execute the following commands to kill any hanging ADB servers and restart the service:
adb kill-server
adb start-server
After restarting the server, clean your project by navigating to Build > Clean Project and then Build > Rebuild Project. This ensures that all intermediate build artifacts are removed and regenerated. When you rebuild, Android Studio will recompile the native code with fresh debug symbols, which should resolve any symbol table mismatches.

Checking GDB Server Settings

For projects using older NDK versions or specific toolchains, the GDB server settings might interfere with LLDB. While modern Android Studio defaults to LLDB, legacy configurations may still reference GDB. Navigate to Run > Edit Configurations and check the GDB Server tab if available. Ensure that the path to the GDB server executable is correct, though it is recommended to migrate to LLDB entirely for better performance and stability. If you are using third-party libraries that include pre-compiled native binaries, ensure those libraries were built with debug symbols enabled. Pre-compiled binaries without debug info will prevent the IDE from displaying source code, leading to the disassembly view regardless of your local configuration.

Verifying Device Compatibility

Ensure that your physical device or emulator has USB debugging enabled and that the developer options are active. On physical devices, confirm that the USB connection mode is set to file transfer or MTP, as some PTP modes can interfere with high-bandwidth debug data streams. For emulators, verify that the hardware acceleration (HAXM or Hyper-V) is installed and functioning correctly, as poor emulation performance can cause timeout errors during the debugger attachment phase. If you continue to experience issues, consider checking the logcat output for errors related to debuggerd or lldb. These logs often provide specific error codes that can pinpoint whether the issue is permission-based, architecture-based, or related to missing dependencies.

Frequently Asked Questions

Why does my debugger show assembly code instead of C++?

This happens when the debugger cannot find the debug symbols (DWARF info) associated with the compiled binary. It usually means the build was done in Release mode, which strips symbols, or the APK installed on the device does not match the version currently in your IDE.

How do I fix "Unable to attach loader" errors?

This error typically indicates that the LLDB server cannot load the native library into memory. Verify that the library name in your JNI code matches the filename in your System.loadLibrary call exactly, and ensure the library is present in the APK's lib/ directory for the target ABI.

Can I debug C++ code on an iOS simulator?

No, C++ debugging via JNI is specific to the Android platform. iOS uses different mechanisms like Objective-C or Swift, and while C++ is supported, the toolchain and integration within Xcode differ significantly from Android Studio's LLDB setup.

What should I do if the debugger crashes immediately?

If the debugger crashes, check the logcat for fatal signals like SIGSEGV or SIGABRT. This often points to a bug in the native code itself, such as a null pointer dereference or stack overflow, rather than a configuration issue with Android Studio.

Does enabling ProGuard affect C++ debugging?

ProGuard primarily affects Java and Kotlin code. However, if you use R8 or ProGuard rules that strip native methods or rename them unexpectedly, it can break the JNI bridge. Ensure your proguard-rules.pro file keeps all native method signatures intact using -keepclasseswithmembers.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More