I recently downloaded Android Studio 3.5.1. Have also downloaded all the SDK tools
Error I am getting
this is the android sdk folder content
How do I resolve this?
Remove the ndk.dir line from your build.gradle. That's the older method of specifying the NDK to use, and that path is wrong for the NDK you've installed.
AGP 3.5 allows you to install multiple NDKs simultaneously (if you check the "show package details" box you'll see that "NDK (Side by side)" expands) and select which one to use in your build.gradle with android.ndkVersion.
You can continue using ndk.dir for now, but it's deprecated and there isn't much reason to.
See https://developer.android.com/studio/projects/install-ndk for more information.
Try like this.
/your/path/Android/sdk/ndk/20.0.5594570
But in case you are creating a native application using Android Studio, I think you should not locate for your ndk path manual.
The issue was the path only. Apparently android studio downloaded ndk as
Library/Android/sdk/ndk/20.0.5594570/allfiles
I had to rename the ndk folder to ndk-bundle and moved the subfolder files to ndk folder.
Related
This question already has answers here:
Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm
(54 answers)
Closed 4 years ago.
Can anyone tell me why I am receiving this error? I have downloaded a series of projects from GitHub for a Udacity course. Since there are about 50 or 60 projects (Exercises and Solutions) in the repo, I presume it has to do with the fact that each is an individual project on its own. I do not have a problem usually when I fork a repo and clone it locally.
I have read other posts about uninstalling and reinstalling ndk in the sdk. But I really want to know why this is happening and how I can fix without blindly uninstalling and re-installing.
Any help is appreciated. Thanks.
After looking around, the solution was to remove the NDK designation from my preferences.
Android Studio → Preferences → System Settings → Android SDK → SDK Tools → Unselect NDK → Apply button.
Project and Gradle compiled fine after that and I was able to move on with my project work.
As far as why this is happening, I do not know but for more info on NDK check out: https://developer.android.com/ndk/
I will go back and enable these libraries but for now.
If you are using NDK >= 18 you have to update your android gradle plugin to >=3.1.x
See the Known Issues section:
https://android.googlesource.com/platform/ndk/+/ndk-release-r18/CHANGELOG.md
for me, upgrade the Android Gradle plugin version to 3.2+ works.
classpath 'com.android.tools.build:gradle:3.2.0'
Android Studio -> Preferences -> System Settings -> Android SDK -> SDK Tools -> Unselect NDK -> Apply button.
It works fine for me.
Updating the Android Gradle plugin is definitely the preferred solution. However, if for whatever reason you can't do that, it's easy to simply "fix" the error without downloading, copying, or symlinking anything, by just creating an empty directory:
mkdir -p $ANDROID_HOME/ndk-bundle/toolchains/mips64el-linux-android/prebuilt/linux-x86_64
$ANDROID_HOME points to the root of the Android SDK installation. On MacOS, replace linux-x86_64 with darwin-x86_64. Use windows-x86_64 on Windows.
It's Because of NDK Version You are selected Follow the steps which will help you to resolve
If you want to use NDK then Update the Gradle Plugin
In build script change Dependecies
classpath { 'com.android.tools.build:gradle:3.2.1'
classpath {'com.google.gms:google-services:3.2.0'}
if you are unaware of the NDK then simply disable it by selecting preferences>System settings>android sdk>Select SDK Tools > uncheck NDK there
Rebuild the project it works just fine
Happy Coding <3
If you don't want to update your gradle plugin you can do this. Download one of the older NDK releases, e.g. r17c. Open downloaded NDK archive, go to toolchains directory and copy missing toolchain folders to toolchains folder of your currently used NDK. In my case the folders I had to copy were mipsel-linux-android-4.9 and mips64el-linux-android-4.9.
After I installed an older Unity version (5.6.0f3) I can't build a simple android app:
Unable to list target platforms. Please make sure the android sdk path
is correct. See the Console for more details. See the Console for
details.
As I understand I need Android tools 25.2.5 or earlier in order to build android apps in Unity 5.6.0f3.
According to this instruction I need just to add the path of the unzipped SDK to the Edit -->Preferences ---> External Tools --->SDK box. The problem is that after that Unity is not accepting this path and asks me to choose a different one.
While following this instruction, since I have a mac, I downloaded and unzipped the file and double-clicked android.bat and installed the recommended packages. But the problem remains, I still see the error message.
What might be the problem and how it can it be fixed?
Thank you in advance!
The reason Unity does not accept the path is because you are not linking the right folder for the sdk path. You may have to play around with the inner/outer folders of the sdk path in order to get it right.
On my mac the file path after installing the sdk is Library/Android/sdk (this is installed from Android Studio so that path may be a bit different).
And on my windows the correct folder is just the unzipped outer folder e.g tools_r25.2.3-windows
SDK / ADK: is the path to the folder that contains "platform-tools" folder (which contain ADB binary)
JDK: is the folder that contains the bin folder that contains java / javac (comipler) binary
NDK: download and unpack this massive ugly zip with 56k files in it. It should be version r13b - untiy doesn't like newer versions. No need to install anything
Thankfully for new versions of Unity assist you in managing those dependencies via the hub, but I am posting the screenshots for future reference as I often find myself looking for the very same answer
Im trying to use my pre-existing NDK with Android Studio , it offers an option of downloading a new NDK and auto setup , but i want to use the version i was using before i downloaded Android Studio , how to tell it the location of the NDK i already have ? Do i have to set the NDK_HOME environment variable ?
Android Studio's documentation tells that when downloading the NDK from the options menu in Android Studio it will be under the SDK's home in a folder called "ndk-bundle" , do i have to put it there ? (soure https://developer.android.com/studio/projects/add-native-code.html)
On my Android Studio (2.2) you can go to File | Project Structure.
You will get the Project Structure dialog. Select SDK Location. You can set the location of your NDK in this dialog as well.
In case anyone passes by there's a work-around that doesn't involve re-downloading the NDK using Android Studio. As the OP points out Android Studio stores the Android NDK in a folder called "ndk-bundle" under the Android SDK's root folder. So, in linux, simply creating a symbolic link (a shortcut, if you use Windows) to the NDK root folder in your SDK root folder solves the problem, like so:
ln -s [FULL_PATH_TO_NDK_ROOT] [FULL_PATH_TO_SDK_ROOT]/ndk-bundle
I believe doing something similar in Windows would work.
Yep, i searched about this but nothing, just things about the ANDROID_HOME path, but in my case i don't think this is the real problem. When i try to do ionic build android i get this error:
Error: Could not find gradle wrapper within android sdk. Might need to update yo
ur Android SDK.
Looked here: C:\Android\sdk\tools\templates\gradle\wrapper
And found that in C:\Android\sdk\tools i dont have "templates" folder, just this:
I see gradle wrapper only in this path C:\Android\sdk\temp\ToolPackage.old01\templates\gradle\wrapper
Why i don't have Gradle in my sdk folder? i am missing something? in SDK manager i have this installed:
Thanks in advance
Had exactly the same problem. This thread points out the reason behind it, and this one actually shows what to do.
In short:
in Android Studio uninstall Android SDK Tools
Download tools_r25.2.3-yourOPsystem.zip from Android Downloads. Basicly same thing, older version.
insert downloaded extracted tools folder in Android/sdk/ folder
(MAC: /Users/username/Library/Android/sdk/tools
Win: C:\Users\username\AppData\Local\Android\sdk\tools)
In project folder run:
$ cordova platforms remove android
$ cordova platforms add android
On Linux android studio version-162.3871768-linux
copy paste
\Android Studio\plugins\android\lib\templates\
to Sdk/tools/
You need to update ANDROID_HOME variable to point the android-sdk folder
https://stackoverflow.com/a/32507036/344895
you have to upgrade your cordova library
cordova platform update android#6.2.1
I tested upgrade cordova to version 6.5 and extract tools SDK. Nothing helps.
In my case I have Android Studio installation.
SOLUTION: Please find file gradle-wrapper.jar in your Android Studio installation (in may case ..\Android Studio\plugins\android\lib\templates\gradle\wrapper\gradle\wrapper\ ). Then copy whole directory templates to SDK location in subfolder tools.
Set ANDROID_HOME to the SDK Path displayed in your Android SDK Manager. The default location is C:\Program Files (x86)\Android\android-sdk if you didn't change it.
go to https://developer.android.com/studio/index.html
cheak Download Option and download tools only
extact file and copy the templates folder
and paste in C:\Users(yourunername)\AppData\Local\Android\sdk\tools
update your sdk tools download tools_r25.2.3-yourOPsystem.zip.
[direct download link][1]
/Users/username/Library/android/sdk/tools
You cant find gradle in latest sdk. So try to install it manually. Follow this link
https://gradle.org/install
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+)