Cant't config downloaded (zip) NDK for Android Studio (windows 7) - android

so I tried to download NDK from StandAlone SDK manager and it didn't have the option! then I went to google developers and read some guides and understood how to get it via android Studio
there was an NDK option in SDK manager -> SDK tools tab , I checked it and after applying it started downloading it, but for some reason after download, it fails to install it (tried 2 time it fails at end of unzipping process at like 100% :| ) ***Note: I have enough space available, 4gb on windows drive, 20gb on SDK drive
***Note2: I deleted the NDK bundle folder and its contents created by the failed install in my SDK folder
so I went to NDK Download
and downloaded the package from there , but I can't get it to work, gradle says "Error:NDK not configured.
Download it with SDK manager.)"
I tried adding the NDKfolder to PATH variable or adding NDK_HOME variable but still the same error
Update 1 : I added ANDROID_NDK_HOME variable now it says : Error:A problem occurred configuring project ':TMessagesProj'.

I had this issue of
Error:NDK not configured. Download it with SDK manager.)
But I solved my problem with this link: Add C and C++ to your Project
you can skip to the heading Download the NDK and Build Tools, but read everything for knowledge.

This error might be, your Android Studio is not able to find the NDK location.
So, try doing this: right click on your project in Android Studio,select "Open Module Settings", select SDK location tab, and provide SDK and NDK locations.

Related

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

Install the Android build tools version 19.1.0

I run ionic run android and it starts to download lots of things except gradle that i downloaded it and set the path myself, now i have 2 question:
1: Should ionic framework always download lots of things with every new project?
and
2: How i resolve the below error , i set ANDROID_PATH variable to point Android-SDK where packages exist
What went wrong:
A problem occurred evaluating root project 'android':
No installed build tools found. Install the Android build tools version 19.1.0
or higher.
The answer is yes (through Gradle) and you have to set ANDROID_HOME and then add to PATH based on this.
On the Mac I had much the same problem. I was lacking the Android SDK. I don't know if that was your problem. I'll assume you don't have the SDK but you can pick up from your problem place in this list.
Download and install Android SDK for you platform. I'm on Mac so will present instructions from that perspective.
Go to Configuration on login splash screen or Preferences through File or Apple menu.
Go to Appearance and Behaviour > System Settings > Android SDK
Observe the Android SDK Location. Mine is /Users/me/Library/Android/sdk
Open ~/.profile
Add export ANDROID_HOME=/Users/me/Library/Android/sdk
Add export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Save and source ~/.profile
You could have the additional problem of not having Gradle installed. Try:
Download the binary
Extract to /usr/local or wherever you can write (eg. ~/lib where I install such things locally) if you don't have admin rights
sym link the version of gradle - cd /usr/local;ln -s gradle-3.5 gradle
Add /usr/local/gradle to your $PATH like above and source ~/.profile again.
I reread the question and realised I had added too much detail in my answer. I believe the $ANDROID_HOME and path line is what you are missing.
You may also need to open Android Studio and do whatever configuration it requires. And setup a SDK Platform also in that configuration window discussed above.
I hope that helps.

NDK not found at specified location

After installing Xamarin Studio I went to the options to make sure the Android SDK, JDK and NDK were all found. The first two in fact were, but the NDK was not found. It asked to specify location, and I did specify the location (when I clicked "browse" it took me to the folder where the NDK actually was). Yet, it still does not recognize it and says NDK not found at the specified location.
When using Xamarin Studio, if you are getting the error XA5101 error ("Missing Android NDK toolchains directory") you would need to download the Android NDK separately from:
http://developer.android.com/tools/sdk/ndk/index.html
Then he should unzip downloaded file and open the Xamarin IDE and go to the following menu location:
Tools ==> Options ==> SDK Locations ==> Android
Select the location of the unzipped folder.
Then close the IDE and reopen it (force close/restart if it persists in task/process manager).
Alternate to try:
Not finding NDK may also be caused because of mismatched configuration
for AVD Manager. More specifically, the Xamarin may be creating
devices & AVDs in your %USERPROFILE%.android while the
debugger/runtime emulation EXPECTS the AVDs in the ADT directory. You
can try copying ZAVD2-related files and directories into the
%USERPROFILE%.android\avd and see if that resolves the issue.
===== Initial post ======
[In case of eclipse] I think the answer is here: https://stackoverflow.com/a/11825963/918535
//goto Preference → Android → NDK and choose your ndk location
//If your NDK location is already set, the builder in the toolchain editor may be wrong. Go to project properties, C/C++ Build | Tool Chain Editor and select Android Builder as current builder.
// in your .bashsrc file, you may also need to add the env variable:
NDK_HOME=/opt/android-ndk-r8
export NDK_HOME
Okay, so I found the issue. There was no ndk-stack.exe file in my NDK location. I was thinking I would delete/uninstall everything related to NDK and reinstall. This is when I came upon ndk-build.cmd, just thought id click it since it was a cmd, and it created the ndk-stack.exe at a location on my computer which was found by both the Xamarin studio and Visual Studio( noticed later that even VS couldnt find the NDK but after the cmd, it did). Thank you for the help.
In case this catches anyone else out, I had this issue but it was because I checked "Enable AOT (Experimental)" in the Android Build Code Generation settings. This setting is off by default so probably should have left well enough alone.
Open ndk-stack.cmd with notepad to see full path of ndk-stack.exe
You can find this file in "installation-path\android-ndk\prebuilt\windows\bin\ndk-stack.exe"
my advice is to download NDK that is coherent to your version of Visual Studio, for instance, if you have VS 2015 download NDK of 2015 or 2016 year, it really helped, cause there wasn't that EXE file in NDK of 2019 version, but it was in the NDK of 2016
Change android min sdk version 4.2 or higher (API LEVEL 17+)

Android Studio doesnt open project correctly

When I import or open a project it doesn't open correctly and in the event log I get the message "Frameworks detected: Android framework is detected in the project Configure". Searching in google it says to install the support library but it's already installed
SOLUTION
Refer to the answer to this question
I ran into the same problems while opening a project. Please make sure when the Android Studio do the conversion or build the Gradle files , you look into the Gradle's build file and check which particular version's SDK and build tools are required to build this particular project. Then also confirm from the SDK Manager (Tools->Android->SDK Manager) that tools of given version are installed.

platform-tools\aapt.exe directory missing in android SDK

I'm trying to get 'hello world' working on the Android SDK with Eclipse. I'm following this tutorial step by step:
http://developer.android.com/resources/tutorials/hello-world.html
but i'm returned the error "Error executing aapt. Please check aapt is present at C:\android-sdk-windows\platform-tools\aapt.exe"
For some reason, the "platform-tools" folder does not exist under my installation. In its place I find "platforms" and "tools". Presumably, my SDK version is different to that used in the tutorial.
I can't work out what i need to change or update. Can someone please point me in the correct direction?
Thank you
Totally agree with izzy, but other times (usually on 64 bit OS machines or with multiple android platforms) when you install the latest SDK version the folder platform-tools had missing the "appt.exe".
To solve this you need to search on *android-sdk\build-tools* folder and subfolders like \build-tools\17.0.0 in my case, and you will find aapt.exe, other necesary files and lib folder, just copy it everything to android-sdk\platform-tools and it will be done.
sometimes you may get the error that it can not install because it can not create the temp folder to install the tools. You simply just need to run the SDK manager as administrator and this will allow it to all work out.
if we will face appt.exe issue (could not found) just Follow the below steps:
1. Just Read It(https://developer.android.com/studio/command-line/aapt2)
Navigate to (ctrl+find and search) com.android.tools.build > then go to aapt2 from this url (https://dl.google.com/dl/android/maven2/index.html)
Insert the version name you copied into the following URL and specify your
target operating system: https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/aapt2-version/aapt2-aapt2-version-[windows | linux | osx].jar
For example, to download version 3.2.0-alpha18-4804415 for Windows,
you would use: https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/3.2.0-alpha18-4804415/aapt2-3.2.0-alpha18-4804415-windows.jar
Extract the jar file, Change the name aapt2.exe to apt.exe
Copy and paste into your android-sdk -> platform-tools
Run the program, Issue will be get resolved
Note: Means you have to download and set the aapt.exe path in System Environment Variable
*What version of the SDK are you running? (1.5_r2 or something?)*
I would suggest updating your SDK and be done with it ;)
You can do so trough the "Android SDK and AVD Manager".
Eclipse:
menu->window->"Android SDK and AVD Manager"
You might also want to change this setting:
menu->window->preferences->install/update->(expand)->automatic updates
Run the Android SDK Manager and be sure that you have checked and installed Tools>Android SDK Platform-tools.
I believe this package is responsible for the folder in question here.
I just found aapt.exe file in my latest Android-SDK folder (Android_SDK\build-tools\28.0.3)
You can check your latest sdk build-tools folder
or
You can search on total Android SDK folder by file name
I was able to delete my version (28.0.3) and Android Studio reinstalled it. The directory location was
C:\Users\YourUserName\AppData\Local\Android\Sdk\build-tools

Categories

Resources