简体   繁体   中英

Can't set Android NDK version on Android Studio

When I try setting ndk version on android studio, via project structure -> sdk location, the search box is grayed out. So I went to the local.properties file, and set ndk.dir there. But the issue is that when I do this, android studio can't sync gradle, and it constantly throws me this "SILLY ERROR"

Gradle sync failed: exception during working with external system:

I tried setting system environment variable for the ndk directory, but it still didn't function !!!!!!!

This IDE is frustrating. where should I set my NDK version then? I stuck and every solution I try online doesn't work.

The recent version of Android Gradle Plugin expect you to install NDK (side by side) via the SDK Manager, and choose the version for your module in build.gradle :

android {
    …
    android.ndkVersion '19.2.5345600'
}

The reason that your SDK location is grayed out might be because you don't have one installed.

I found this question asked earlier that can help you solve this problem:

Android Studio SDK Managed Disabled

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM