简体   繁体   中英

Can't Configure NDK path on android studio

I have an android studio project which requires the NDK to be set. I had downloaded an NDK manually and extracted it to a directory in my C: drive. What I did was to follow the instructions which are online and I went to: File->Project structure, and tried to set the NDK path. But the search box there was disabled as shown in the image,

在此处输入图像描述

I then set environment variables to point where the ndk was located. Here are the names I used for the environment variables: "ANDROID_NDK_ROOT" and later "ANDROID_NDK_HOME" when the former didn't work.

So I clicked on the Download button below the disabled search box. After letting android studio do its thing and download another NDK, I restarted android studio, just find out that the search box was disabled, and I couldn't set the NDK path.

Then I went to SDK Manager -> SDK Tools -> I checked the android NDK and CMAKE, then waited for it to download.

But after downloading again, android studio still couldn't find the NDK. I set the environment variables and even restarted my PC.

This thing is extremely frustrating, what the hell have I done wrong? Please can someone tell me?

Open local.properties and add

ndk.dir=C:\Users\PC\AppData\Local\Android\Sdk\ndk\ndkversion

download ndk if previously not exist in directory

https://developer.android.com/ndk/downloads

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