Error while doing Ionic build android - android

I have followed all the tutorials that is to be followed and done the settings correctly. I am getting the following error
[Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.]
Now possible solution to the problem is to add the path to your Android sdk in the $ANDROID_HOME and $PATH variable
Here is the output
echo $PATH
/home/samyak/anaconda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/java/jdk1.8.0_65/bin:/usr/local/java/jdk1.8.0_65/jre/bin:/usr/local/java/jdk1.8.0_65/bin:/usr/local/java/jdk1.8.0_65/jre/bin:/home/samyak/Android/Sdk/tools:/home/samyak/Android/Sdk/platform-tools
echo $ANDROID_HOME
/home/samyak/Android/Sdk
as soon as I do android I get the gui of android. I think I am missing something. If somebody could help me out
Version details
Ionic 1.7.11
Cordova 5.4.0
Android-sdk 23
Also to note that I did not download the Android Sdk but took it from a friend via hard drive? Will that effect my android build?

Make sure you have the Android Tools inside the path folder.After you have the Android SDK downloaded and installed, you need to install build tools for the version of android you're targeting. You will need to check:
Tools
Targeted Android API Version
Extras
and hit Install in the Android SDK Manager. If something is missing after this, install
what build tool is complaining about.

Related

How to fix 'Android SDK not found at this location' error while installing flutter?

I'm installing flutter in my Ubuntu 18.10. I'll be using Visual Studio Code for flutter development. I've not installed Android Studio.
I've downloaded Android Command line tools from official android site and extracted it in a separate folder in Documents/development/android
I set the path for ANDROID_HOME in the bashrc file by following the flutter documentation
Here is the .bashrc file
And the Android toolchain error
It seems that , you set the ANDROID_HOME variable but it is not added to PATH.
Make sure you add the ANDROID_HOME to the path as below
export PATH=$PATH:$ANDROID_HOME/bin
and re-launch the console.
update
In order for Android SDK to work fine, you need to set path for the below SDK packages.
..android-sdk\tools
..android-sdk\platform-tools
and your ANDROID_HOME will be
..android-sdk
I am not sure what you are referring to when you are saying that you have downloaded Android Command Line tools. From the output in your terminal, it tells me that you do not have the SDK files in your machine. To download the Android SDK, please see this link here and download the tar file that matches your operating system. Then extract the tar file in the folder which you have set as ANDROID_HOME. This should work fine.
In case you are having the same error, I strongly recommend downloading the Android Studio and install the Android SDK through the Android Studio. The flutter documentation says so as well. You can always uninstall or remove Android Studio after it is being installed and if you are not considering using it.
please replace yout android sdk in thatway this is default installation location of sdk C:\Users\Intel\AppData\Local\android\android_sdk

Failed to find environment variable ANDROID_HOME while working with cordova ubuntu

I am new in Hybrid app development.I have been assigned a task to develop Android & IOS app using Cordova apache.
As I work on Lamp environment, so I started installing the software for the same.
Software I have installed are
Cordova
npm
Android studio
apache ant
PhoneGap
But even after installing and following the all the instructions given on the internet.I am not able to prepare my build for the testing purpose.
Below is the error I am facing/getting when running the command sudo cordova requirements
Requirements check results for android: Java JDK: installed 1.8.0
Android SDK: not installed Failed to find 'ANDROID_HOME' environment
variable. Try setting setting it manually. Failed to find 'android'
command in your 'PATH'. Try update your 'PATH' to include path to
valid SDK directory. Android target: not installed Android SDK not
found. Make sure that it is installed. If it is not at the default
location, set the ANDROID_HOME environment variable. 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. Error: Some of requirements check
failed
Note:I have already set the environment variable in .bashrc file ,but still facing the issue .
Please help!
in /home/user/.bashrc you must to set the ANDROID_HOME and PATH like this:
export ANDROID_HOME=/home/user/Android/Sdk/
and you PATH like this:
export PATH=/home/user/Android/Sdk/tools/:$PATH

Android variable creating issue when sudo meteor run android-device perform

export ANDROID_HOME=/home/haiderali/android-sdk-linux
export PATH=${PATH}:/home/haiderali/android-sdk-linux/tools
export PATH=${PATH}:/home/haiderali/android-sdk-linux/platform-tools
i added this on bashrc file and run this command "sudo meteor run android-device" it's give me environment error but I successfully installed all the tools required for meteor android build.
Your system does not yet seem to fulfill all requirements to build
apps for Android.
Please follow the installation instructions here:
https://github.com/meteor/meteor/wiki/Mobile-Development-Install:-Android-on-Linux
Status of the requirements:
✓ Java JDK
✗ Android SDK: Failed to find 'ANDROID_HOME' environment variable. Try
setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your
'PATH' to include path to valid SDK directory.
✗ 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.
✗ Gradle: 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' envvariable.
Please Somebody help. :(

could not find adb:do you have android sdk installed and the tools + platform-tools folders added to your PATH?

Actually I have set the path in Environment variables.
By adding new path like ANDROID_HOME and value set to D:\adt-bundle-windows-x86-20140702\sdk
and in systems variables I have edited the path as PATH and the value set to D:\adt-bundle-windows-x86-20140702\sdk\tools\;D:\adt-bundle-windows-x86-20140702\sdk\platform-tools\
When I run the web driver script using junit I am getting the following error
A new session could not be created. (Original error:could not find adb:do you have android sdk installed and the tools + platform - tools folders added to your PATH?)
I have created script in web-driver using JUnit and I have launched emulator. And I have started appium server. I am not getting any error in my coding.
Please help me in resolving this issue.
Do you have adb under platform-tools or tools? check if that is true.
For ex: in mac os if you dl the standalone sdk you do not get a proper build and you have to update your platform tools/tools.
You can open your sdk manager and choose to update your platform tools/tools/build tools if you happen to have an empty/incomplete version of either.
Hope that resolves your issue.

The command 'android' failed

I've read this: Cordova and setting Android using command line
and that How to add android to cordova platform? PATH error? and generally speaking whole documentation. I've added both 'platform-tool' and 'tool' paths, installed android 4.4 and I'm still getting the error from the tittle when I'm trying cordova platform add android to my current project ( in cmd and in netbeans ).
The only thing I haven't done is adding java and ant to path. I was trying with ;%JAVA_HOME%\bin;%ANT_HOME%\bin but still those commands aren't recognizable.
What else can I do?
EDIT:
I've added java and ant to PATH. This is what I get in cmd:
C:\xampp\htdocs\mobile_maps>cordova platform add android
[Error: The command `android` failed. Make sure you have the latest Android SDK
installed, and the `android` command (inside the tools/ folder) added to your pa
th. Output: ]
Second EDIT:
i also get 'xcopy' is not recognized as an internal or external command even though I've added %SystemRoot%\System32; %SystemRoot%; %SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0 . I really don't know what else I can do..
usually this happens when:
1. Java is not installed
2. Java is not exported (no JAVA_HOME env variable) or paths are wrong
3. only 64bit version of Java is installed
to fix install 32bit support on your system.
and (as comments below) relog in Windows to environment changes take effect.

Categories

Resources