Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio Where to install NDK file? (downloaded it in zip)

My android studio said it wanted to update. But when I did I tried to update it but it wouldn't work so I had to launch:
C:\Users\username\AppData\Local\Android\sdk\tools\android.bat
to install other packages. But the NDK file wouldn't update, so I manually downloaded it from:

https://developer.android.com/ndk/downloads/index.html#download

Now I have this zip file and where should I extract the folder? Grateful for any help!!

The folder name is android-ndk-r13b.

like image 684
Tim Avatar asked Nov 07 '16 20:11

Tim


People also ask

Where can I find NDK location?

Open your Android Studio Preference (or "File->Settings") > Appearance & Behavior > System Settings > Android SDK. You can find the path to your SDK and NDK, which is in the same directory.

How do I know if android NDK is installed?

You'll need to point to your NDK in your eclipse by adding the path of ndk-build to Window > preferences > android > NDK. Right click on your project folder. Choose android tools -> add native support (the bottom one) and click finish. Now it will ask for a name for your .


2 Answers

Yes, rename the extracted folder android-ndk-r13b(probably the exact name will be outdated someday soon) to ndk-bundle (you can put the NDK [and SDK for that matter] anywhere, and leave the name alone if you want {do not do this, I'm sure seen one case of hard-coded sub-path}),
then, make the settings point to the location where you put it.

Android Studio, File menu | Project Structure Ctrl+Alt+Shift+s
(short-cut: ctrl+Alt+Shift+s):

Android Studio, File menu | Project Structure

It might also be helpful to you to set/check the following environmental variables:

NDK_HOME=C:\Android\sdk\ndk-bundle NDK_MODULE_PATH=C:\Android\sdk\ndk-bundle 

EXTRA stuff:

While were doing environmental variables (belt-and-braces for SDK):

ANDROID_HOME=C:\Android\sdk 

For JDK:

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_112 JAVA_PATH=C:\Program Files\Java\jre1.8.0_112\bin 

JDK is the Java Development Kit.
JRE is the Java Run-time Environment.

If your tight on memory (RAM) for Gradle (700 Megabytes is about as low as you can go, other tools like monitor.bat use this variable too, it's ubiquitous) (clearly you want to make it as big a possible, without swapping making it extremely slow to build {note the underscore VERY important ! [it's a reserved name space conflict operator, don't ask me to explain it's VERY complicated !]}):

_JAVA_OPTIONS=-Xmx700m 

Some Links

Setting up for Android NDK development
Add C and C++ Code to Your Project
Getting Started with the NDK
Using C and C++ Code in an Android App with the NDK

like image 110
Jon Goodwin Avatar answered Sep 20 '22 09:09

Jon Goodwin


Download the .zip file. Start the installation through SDK manager.
Go to %userprofile%\AppData\Local\Android\sdk\ndk-bundle and copy .installer folder to desktop and cancel the downloading in SDK manager.
Open .installer folder and open .installationdata file and check the folder in which the file is being downloaded like:
%userprofile%\AppData\Local\Temp\PackageOperation01.
Copy downloaded .zip file to the folder PackageOperation01 or whatever listed in .installationdata file.
Now copy the .installer folder from desktop to %userprofile%\AppData\Local\Android\sdk\ndk-bundle
and start the SDK manager
and start the installation again for NDK.
The SDK manager will start the installation skipping the download process.

like image 36
Sangramb3 Avatar answered Sep 22 '22 09:09

Sangramb3