Share via

Not able to debug c++ code on visual studio 2022

Gaurav Sharma 0 Reputation points
8 Oct 2024, 5:33 am

I am developing android application using c# and c++. my application uses c++ library. whenever I select c++ debugger in android project properties window and i run my app in debug then I get an error which is attached as image to this question. I already installed cross-platform development workload in visual studio set-up and also I added a registry key in registry editor with NDK_HOME key and value. even after this, visual studio is not able to find NDK_HOME registry key. please help me to resolve it.

User's image

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,765 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
1,005 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 31,401 Reputation points Microsoft Vendor
    9 Oct 2024, 7:51 am

    Hello @Gaurav Sharma,

    Welcome to Microsoft Q&A forum.

    I tried to reproduce this issue but failed. Perhaps you can try/double check following:

    1. Tools > Options > Cross Platform > C++ > Android > Android NDK.

    User's image

    1. Install NDK manually(Tools > Android > Android SDK Manager > switch to Tools tab > NDK).
    2. Reinstall related Workloads and components from VS Installer > Modify.
    3. Is there any special or specific setting in your solution? Is this Android application developed by using VS 2022? If not, will the same issue appear in previous version of VS, for example VS 2019/2017(if it's possible, you can try to install previous version of VS just for test. It's useful for narrowing down this issue)?

    Best Regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.