Android target : not installed - android

I am unable to run ionic run android. After I checked with cordova requirements, it shows
Android target: Not installed
Android SDK not found.
How should I solve the problem? I have my SDK in D drive where I have set ANDROID_HOME and path correctly, I suppose
Also, I do android list target, it shown as below. How should I intsall it if it is needed to fix teh error?
Attached the cordova android version

You can follow this link set ANDROID_HOME which I got help from or follow below guide.
I had similar trouble but managed to fix it. After successful installation of android studio, Android SDK will be downloaded by default to a directory like this "C:\Users\abc\AppData\Local\Android\sdk1" where "abc" in this case is your PC name. AppData is a hidden folder.
Next step is to set ANDROID SDK path. From Advanced System Settings, click Environment Variables then under User variables add New as shown below.
Next, add android 'tools' and 'platform-tools' to System variables' 'Path' as shown below. These tools are inside sdk folder.
Set up is done. Open cmd and issue android command. If all is well, you should see below output.
Finally open a new terminal window and navigate to your cordova project directory, in my case "hello" and check platfrom requirements. All should be fine now.

I had a similar problem. The issue was I was using the latest version of Java which was 10.0.1
You can check yourself by typing in terminal:
java --version
And it was
java 10.0.1 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
Currently, Cordova needs on their documentation page as JDK 8. SEE DOC HERE
You can download JDK 8 from the official website here
Once you download you need to set up JAVA_HOME variable. Use this for setting up JAVA HOME when you have multiple version of JAVA installed.
Then you can run
cordova requirements
or
cordova build android
This worked for me. Hope it helps someone.

Related

Cordova fails to find ANDROID_HOME environment variable

I looked all over Google and Stack Overflow for an answer, but I couldn't find the right one for me. I am learning Cordova and I'm trying to run the android emulator through terminal, and when I run 'sudo cordova emulate android' I get this message:
''Failed to find 'ANDROID_HOME' environment variable. Try setting it manually.
Detected 'avdmanager' command at /Users/username/Library/Android/sdk/cmdline-tools/latest/bin but no 'tools/bin' directory found near.
Try reinstall Android SDK or update your PATH to include valid path to SDK/tools/bin directory.''
But I set the variables in the ~./bash_profile file and it looks like this:
export ANDROID_HOME="/Users/username/Library/Android/sdk"
export ANDROID_SDK_ROOT=$ANDROID_HOME
export PATH=${PATH}:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools
export PATH=${PATH}:$ANDROID_HOME/tools/bin
export PATH="$PATH:$ANDROID_HOME/build-tools/30.0.0-rc2"
I am using a MacOS Mojave, does anyone know what the issue is?
Thanks in advance
Apparently, in the latest version of Android Studio, the old SDK tools (under /tools, which Cordova seems to expect) are already considered obsolete. There is a solution documented here on how to install the old version of SDK tools.
Open Android Studio
Open Tools -> Sdk Manager
Click on the Sdk Tools Tab
Uncheck Hide Obsolete Packages
Check Android Sdk Tools (Obsolete)
Click Apply
This should download the old SDK tools under the correct folder.
However, I think Cordova also needs to keep up with the newest Android development tools. There's another change I needed to make after this:
I had to delete the tools/emulator and tools/emulator-check binaries, and add $ANDROID_HOME/emulator to my $PATH, since the current emulator binary lives under emulator/emulator instead of path/emulator. See this post.
Then I was finally able to launch the app directly via Cordova.

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

Could not find gradle wrapper within Android SDK

i am new in Ionic. I added android platform in my ionic application and tried to run the application in real android device but i am getting following error in my command prompt i am using windows 10 machine on my end.
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: C:\Users\CURRENT_USER\AppData\Local\Android\sdk\tools\templates\gradle\wrapper
following are my environment variables:
ANDROID_HOME=C:\Users\CURRENT_USER\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files (x86)\java\jdk1.8.0_121
Please suggest
I think you need to update android sdk,
First you update your android sdk atleast API LEVEL 19 & tools & extra options
as follow
& make sure to add sdk url in environment variable
New Android Studio has moved gradle wrapper to C:\Program Files\Android\Android Studio\plugins\android\lib\templates\gradle\wrapper. I copied the templates\ folder to sdk\, then passed the compilation. However the command "Ionic emulate android" still failed with "Error: cmd: Command failed with exit code 1". I don't know how to go further :(

How do I setup Cordova?

I am having some problems with getting started with my first Cordova app in Visual Studio.
When I create a new Cordova Project, I am presented with a page that says:
We've detected issues with your system's environment configuration
And it lists 3 things that need to be installed:
Android SDK The software is missing from your system. You may also have to configure it after installation. Instructions
Apache Ant The software is missing from your system. You may also have to configure it after installation. Instructions
Git CLI The software is missing from your system. You may also have to configure it after installation. Instructions
I already have the Android SDK installed. So how can I let Visual Studio know where it is? A search for this on Google did not yield any results that were related.
Searching for Git CLI did not yield any results. How do I install this?
I haven't even tried installing Apache Ant yet because I can't get past the other two.
How can I install Git CLI and how do I let VS know where my Android SDK is located?
P.S. I am aware that each of those list items has an 'instructions' link, however, I am unable to access those pages, they say "Webpage is not accessible" in Chrome, Firefox and IE (and Spartan).
I guess you have already installed Tools for Apache Cordova.
Once you did that and you can't install them with the tool, download them manually in their official websites. You can then add the path for these items in :
Tools > Options > Tools for Apache Cordova > Environment Variables
Here is a screen of mine :
I hope it helps
Not sure these are solutions, but something to check for:
If you're using VS2013, ensure you have update 4. Visual Studio Tools for Cordova only relies runs on VS 2013 and 2015.
Of course, ensure you have the latest Tools for Cordova CTP 3.1 (http://www.microsoft.com/en-us/download/details.aspx?id=42675)
In my system path, I have C:\Program Files (x86)\Android\android-sdk\platform-tools. I have ANT_HOME as a system/environment variable set to C:\apache-ant-1.9.3. I have ADT_HOME as a system/environment variable set to C:\Program Files (x86)\Android\android-sdk. I have GIT_HOME set to C:\Program Files (x86)\Git.
Setup your PATH environment variable on Windows
From the Desktop, right-click My Computer and click Properties.
Click Advanced System Settings link in the left column.
In the System Properties window click the Environment Variables button.
Select the PATH variable from the System variables section.
Select the Edit button.
You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use "C:\Development\android-sdk-windows" as the directory the SDK is installed in. Append the following text into the text box:
;C:\Development\android-sdk-windows\platform-tools;C:\Development\android-sdk-windows\tools
Save your edit. Close the Environment Variables dialog.
Additionally, you may need to include %JAVA_HOME%\bin to your PATH as well. To check to see if this is required, run a command prompt and type java. If the program can not be found add %JAVA_HOME%\bin to the PATH. You may need to specify the full path instead of using the %JAVA_HOME% environment variable.
Finally, you may need to include %ANT_HOME%\bin to your PATH as well. To check to see if this is required, run a command prompt and type ant. If the program can not be found add %ANT_HOME%\bin to the PATH. You may need to specify the full path instead of using the %ANT_HOME% environment variable.

Android installation/SDK Manager issues

I have downloaded android-sdk_r08-windows.zip and installed it in c:\. When I try to run the SDK Manager, it briefly pops up a DOS window then closes. Trying to run adroid update sdk results in a null pointer exception. I have tried uninstalling/reinstalling the SDK for both android and java multiple times. This is on windows XP SP3. Any ideas?
Thanks,
John
C:\android-sdk-windows>java -version
java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing)
C:\android-sdk-windows>tools\android.bat update sdk
[INFO] Starting Android SDK and AVD Manager
No command line parameters provided, launching UI.
See 'android --help' for operations from the command line.
java.lang.NullPointerException
at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1155)
at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1134)
at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:376)
at com.android.sdkuilib.internal.repository.UpdaterData.initSdk(UpdaterData.java:230)
at com.android.sdkuilib.internal.repository.UpdaterData.<init>(UpdaterData.java:107)
at com.android.sdkuilib.internal.repository.UpdaterWindowImpl.<init>(UpdaterWindowImpl.java:86)
at com.android.sdkuilib.repository.UpdaterWindow.<init>(UpdaterWindow.java:54)
at com.android.sdkmanager.Main.showMainWindow(Main.java:297)
at com.android.sdkmanager.Main.doAction(Main.java:260)
at com.android.sdkmanager.Main.run(Main.java:99)
at com.android.sdkmanager.Main.main(Main.java:88)
Apparently my system had a residual .android folder lying around from when I played around with the android SDK over a year ago. Renaming that file resulted in the SDK Manager coming up.
Make sure the JDK path is added to the Environmental variables.Its usually happenes when a JDK/JRE uninstall is succeeded by another JDK install
Have you installed the JDK, rather than the JRE?
Also, check that your JAVA_HOME variable points to your JDK install path.
instead of opening android sdk manager open android.bat in tools folder. i think it is sdk\tools
You need make sure that:
1) JDK or JRE is installed
2) Within System Variables, the JAVA_HOME variable is set to your JDK/JRE folder (e.g. C:\Program Files\Java\jre7)
3) Your PATH variable includes %JAVA_HOME%\bin

Categories

Resources