Gradle sync failed, NDK not configured, download it with SDK manager

前端 未结 11 2812
难免孤独
难免孤独 2020-12-24 01:25

I am completely new to Android development and just installed Android Studio. I\'m doing a very basic HelloGL2 exercise, and I opened up the HelloGL2.iml file. I tried runni

相关标签:
11条回答
  • 2020-12-24 01:28

    My version is a little bit different :

    From an open project, select Tools > Android > SDK Manager from the main menu. In Appearance & behavior > System Settings > Android SDK I have to Click the SDK Tools tab. Check the box next to NDK Click apply

    0 讨论(0)
  • 2020-12-24 01:30

    For above Android Studio 4.0, paste this in local.properties:

    ndk.dir=C\:\\Users\\USER\\AppData\\Local\\Android\\Sdk\\ndk\\21.3.6528147
    
    0 讨论(0)
  • 2020-12-24 01:34

    I double-checked that I already had the latest NDK installed (so that wasn't the solution for me). Next I did the following: Android Studio Menu -> File -> Project structure -> SDK Location. Here, no NDK was selected, so I selected the latest version. This solved the problem.

    This fix only works locally for this particular machine and for this project by writing your choice to the local.properties file in your project's root.

    UPDATE: There's also a way to set this globally via ANDROID_NDK_HOME environment variable. This is how I invoke building my project on a build server:

    export ANDROID_SDK_ROOT=/home/jenkins/Android/Sdk/; export ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/21.0.6113669; ./gradlew assembleRelease
    
    0 讨论(0)
  • 2020-12-24 01:39

    if you see this error you may have not any NDK in your SDK.

    so you better download it from hereand copy all folders and files in your SDK.

    also you can go; open project>select tools[in upper page]>Android>SDK Manager[from main menu]>click SDK Tools tab>and check the box next to NDK

    if you have not NDK in SDK Tools tab,you can download automatic in this folder

    0 讨论(0)
  • 2020-12-24 01:42

    //Try this one 1 - Android Studio -> Tools -> SDK Manager -> select SDK Tools

    2 - Check the boxes next to LLDB, CMake, and NDK

    3 - Apply and press OK button ..

    0 讨论(0)
  • 2020-12-24 01:42

    worked !!

    1. Go to SDK manager > android sdk(left side) > SDK Tools
    2. download or if availble then update to NDK(side_by_side) and CMake

    3. now, do OK or Apply 4. Get back and click on "Install NDK '21.0.6113669' and sync project" in your failed build.

    Happy coding :)

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