I know there are many threads like this but none of them helped.
I am using Windows 10, Cordova 7.1.0 (latest version) and I have installed Android Studio with SDK Platform 7.1.1 - API level 25 (also tried downgrading to 7.0 - API level 24). Also, I installed SDK build-tools using Android Studio SDK Manager.
Running:
cordova info
I get this message:
Android SDK is not set up properly. Make sure that the Android SDK
'tools' and 'platform-tools' directories are in the PATH variable.
'android' is not recognized as an internal or external command,
operable program or batch file.
Running
cordova requirements
I get this message:
Android SDK: not installed
Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually. Detected 'adb' command at
C:\Windows but no 'platform-tools' directory found near. Try reinstall
Android SDK or update your PATH to include valid path to
SDK\platform-tools directory. Android target: not installed cmd:
Command failed with exit code 1 Error output: 'android' is not
recognized as an internal or external command, operable program or
batch file. Gradle: not installed Could not find gradle wrapper within
Android SDK. Could not find Android SDK directory. Might need to
install Android SDK or set up 'ANDROID_HOME' env variable.
I also tried to install manually the SDK, without Android Studio, but it did not help. I am not used to working with CLI's so I may be missing something.
However, I tried upgrading Cordova, downgrading SDK and installing the latter manually. I was also confused with environment variables, I tried some things I read but none worked. Any help, appreciated.
I figured it out.
Seems that in my case, Java JDK 9 was causing the problem. Downgrading to JDK 8 gave me the solution.
In addition, I hadn't set the ANDROID_HOME variable correctly but even when I did, it did not work until downgrading to JDK 8.
Related
I had built an angular application and wanted to turn it into a native android app using cordova.
I had previously installed android-sdk using apt-get which was added to by /usr/lib folder. I also had installed Android Studio separately who's sdk-tools were located in ~/Android/Sdk.
Previously, my $ANDROID_HOME variable contained path /usr/lib but after installation of Android Studio I had changed it to <myhomedirectory>/Android/Sdk
Previously, the android-sdk tools installed had version 23, which was incompatible with the newer version of gradle, and gave me the following error upon running cordova run android (with sudo) in my project:
WARNING: The specified Android SDK Build Tools version (23.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.3.0.
Android SDK Build Tools 28.0.3 will be used.
Followed by the following error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
platforms;android-28 Android SDK Platform 28
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
Using Android SDK: /usr/lib/android-sdk
The Android Studio I installed had tools installed for both API 28 and API 29, but I did not know why it was still giving me this error, until I noticed the last line of this error, which stated that my Android SDK is being fetched from /usr/lib (the old directory). I tried checking the environment variables again, sourcing the ~/.bashrc, as well as logging out but nothing really worked.
I decided to remove the previously installed android-sdk and purge the files using apt but even then nothing happened.
I even removed the mobile folder (the project folder for cordova I created) and even restarted from scratch, but it still gave me the same error.
I am unsure why it is still picking up the wrong path from environment variable, I've even echo-ed the variable and the path is the one I set just recently, but cordova for some reason seems to disagree.
There was an issue with the permissions in the cordova project. Had to sudo chown -R <myproject>. I first noticed when I tried sudo cordova requirements instead of cordova requirements (which said I had all requirements installed). I noticed these installations were on user level not on root level, which is why upon sudo it was giving me an error. After chown-ing simply run cordova run android. You'll no longer have issues.
I am trying to build and generate an apk for my Ionic 4 application. When I attempt to do this, I am met with the following error:
A problem occurred evaluating project ':CordovaLib'.
[cordova] > No installed build tools found. Install the Android build tools version 19.1.0 or higher.
I have looked at many other solutions on Stackoverflow for this problem and nothing has fixed my issue. I have the Android SDK and SDK tools installed through the Android Studio SDK manager.
I have ANDROID_HOME set in both my .bash-profile and Android Studio path variables. Here is what my .bash-profile file looks like, which is where I believe environmental variables are intended to be set?
export ANDROID_HOME=~/Users/zacharyjordan/Library/Android/sdk
export ANDROID_SDK_ROOT=~/Users/zacharyjordan/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator
When I attempt to build my application, it doesn't even seem as if Ionic is detecting my updated ANDROID_HOME path. It lists ANDROID_HOME as ANDROID_HOME=/usr/local/Caskroom/android-sdk/4333796
If anyone knows what I can do to get my app to build properly I would greatly appreciate it. No other solutions on Stackoverflow have fixed my problem thus far.
I just troubleshooted this error on a coworker's computer and the problem was an environment variable called ANDROID_SDK_HOME that was set to a different folder (C:\Android in his case). Changing that variable to match the actual sdk folder fixed the issue.
First of all you get that because of your environment path is not correct.
What worked for me (Windows 10):
open Android Studio -> SDK Manager -> SDK Tools
☐ Hide Obsolete Packages
☑ Show Package Details
From Android SDK Build-Tools list
☑ 29.0.3
Set the PATH for the ANDROID_HOME to YOUR_PATH\sdk
I have the Android SDK and SDK tools installed through the Android
Studio SDK manager
SDK tools is different than the build tools.
Go to SDK manager, download build tools v19.1.0 or higher then error should be gone.
I managed to resolve my issue with the above error by creating 2 environment variables on my OSX machine for ANDROID_HOME this essentially is the same as what you did above but for my paths. (I had not done this prior.)
After that I ran the command sdkmanager "platform-tools" in my cordova projects CLI. I had difficulties resolving this issue before using Android Studios SDK Manager but this method seemed to clear things up.
Note: If build tools cannot be found for your project. It's worth trying sdkmanager "build-tools" in your CLI.
Hope this helps.
I fixed it by
export ANDROID_HOME=~/Android/Sdk
After updating Android Studio to 2.0 l am getting this error unable to obtain debug bridge and Android Device Monitor does not open. Anyone faced this error before?
I just open sdk manager and installed all android sdk tools and done.
Check whether you need to install "Android Sdk Platform Tools" in the Android SDK Manager.
Somehow, after installing Android Studio from the bundle (for Linux) I lacked the "platform-tools" directory in "Android/Sdk", where the adb executable resides. Installing the platform tools helped. It was easier to find in the standalone sdk manager.
This is because you deleted the adb.exe (it might be your antivirus who deleted it),that resided in the platform tools in the android sdk folder.
What you need to do is to delete the current platform-tools in the sdk manager program and re install it all over again.
I installed the right sdk version that matched my virtual device android version
I am also running the same problem when update android studio from 1.4 to 1.5 stable version. When I run adb command from terminal then i found following error :
bash: ./adb: cannot execute binary file: Exec format error
After R&d I found that this error occurs due to unsupported architecture. In my case:
I am using ubuntu14.04 LTS 32-bit. I observed that after updation, lib folder under platform-tools converted to lib64. I think above error occurs due to 32-bit architecture because after updation 32-bit support removed.
For permanent solution upgrade you system to 64-bit architecture.
Quick solution is to replace the updated platform-tools folder with old one that containing the lib folder instead of lib64.
I think 32-bit architecture support for android development stopped by google for future releases. But I am not sure.
I am phase these error when updating Android-SDK Plateform-Tools 23.1 in Android SDK Manager
i am worked on ubuntu 14.04 [32bit] that is not supporting with Plateform-Tools 23.1 it is only supporting in 64bit Operating System architecture that's why downgrade my Plateform-tools 23.0
it works perfect...!!!
Go to: Android Studio Settings > Appearance & Behavior > System Settings > Android SDK:
If path for SDK are text in red, change to your SDK folder and click ***APPLY***
Open the standalone SDK manager and install the platform tools package.
Since I got some errors in my android emulator I manually updated my Android SDK using the command line sdkmanager. It seems the "old" SDK Manager does not support updates anymore. I do not have Android Studio installed (I did not need it since VS2015 installed the platform tools, too). After the update I have to use command line tools for avdmanager and sdkmanager. The "old" AVD Manager and SDK Manager do not work anymore.
However after this update Visual Studio 2015 could not compile my Codova app. I always got the error:
Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.
Before the app was building correctly.
I did set up the ANDROID_HOME variable to the SDK path (same path as in ADT_HOME). I also tried the suggestion by Abdul Rauf Mujahid to manually edit the regedit.
Both actions did not help.
The ADT_HOME variable is still a valid path.
It seems that others had similar problems Shandu
It seems that android was removed in the last update of the tools. In order to resolve this issue I had to downgrade my Andoid tools and platform-tools.
I downloaded the older revisions of sdk tools Revision 25.3.0 (March 2017) as well as platform tools Revision 25.0.3 and copied them into the relevant folders.
Now I can again compile my Cordova app
For a client of mine, I try to run the meteor run android command on a mac and I got the following message:
✓ Java JDK
✓ Android SDK
✗ Android target: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.
The situation so far:
PATH is correctly defined with links to the tools and to the platform-tools, ANDROID_HOME is fine too
The emulator and the SDK are installed with Android Studio
gradle is not found either, the tools/templates/wrapper path does not exist, which make me suspect a bad SDK installation, yet Android Studio handles everything
Meteor version is 1.3.3 for this project, and of course android paltform has been added to the project, which run fine on my Linux laptop
Verbose is not that verbose, in which situation Android SDK is okay and Android target is not ?
This is very hard to debug and I am desperate to find a solution, this issue seems unresolved in other related threads. Thanks for your help!
This is actually a bug due to the new version of the Android SDK Tools (> 25.3).
The solution is to go back to 25.2.x, the Meteor guide mobile page has been updated a few hours ago.
See the related Github issue
Links to download 25.2.5 version:
https://dl.google.com/android/repository/tools_r25.2.5-linux.zip
https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip