Unable to find CMake in Android Studio

后端 未结 13 1041
暖寄归人
暖寄归人 2020-12-07 22:37

I need to add C/C++ code in my Android program for which I needed LLDB, CMake, and NDK. I found LLDB and NDK in SDK manager, but CMake is missing from there. I tried manuall

相关标签:
13条回答
  • 2020-12-07 23:02
    1. Check in your build.gradle file for your App's module

      externalNativeBuild {
          cmake {
              path "CMakeLists.txt"
          }
      }
      
    2. Remove the cmake section

    3. Re-synchronise the project: go to menu Build -> Refersh Lined C++ Projects

    4. Right-click on the module, such as the app module, select "Link C++ Project with Gradle" from the menu.

    5. You should see a dialog similar to the one shown in below figure.

    6. Click OK.

    0 讨论(0)
  • 2020-12-07 23:03

    You can install it in the SDK Manager Tools, but first you must close your opened project. Use configuration on start menu.

    0 讨论(0)
  • 2020-12-07 23:07
    • Go to Android SDK manager
    • Select Android SDK Tools
    • Find CMake and click Apply to download.
    • Later click OK
    0 讨论(0)
  • 2020-12-07 23:08

    1. Open Android Studio
    0 讨论(0)
  • 2020-12-07 23:11

    If you do the following you may get CMake without any problems:

    1. Open the Settings (Android Studio);
    2. Search by "Android SDK";
    3. On the right side, go to the "SDK Tools" pallet|tab;
    4. Check the "CMake" item on the list;
    5. Press OK button;
    6. Now, just wait the next century while Gradle builds, =D .
    0 讨论(0)
  • 2020-12-07 23:13

    Check if you are using a 64-bit version of Android Studio. In Android Studio 32 bit, CMake will not appear in SDK Manager.

    0 讨论(0)
提交回复
热议问题