I'm trying to add the android platform to my phonegap project. I've added already the iOS platform which worked without any problems. When trying to add android via command
phonegap local run android
I'm always getting this error:
[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 path.
I have already downloaded the latest Android SDK and I set a PATH to the tools and platform-tools folder as well.
export PATH=${PATH}:/Documents/android/sdk/platform-tools:/Documents/android/sdk/tools
I also updated my bash_profile file properly with
source ~/.bash_profile
It turned out that the path to the Android SDK have to be absolute path. After changing my path to something like
export PATH=${PATH}:/Users/your-username/Documents/android/sdk/platform-tools:/Users/your-username/Documents/android/sdk/tools
I could now successfully add the android platform to my project.
Related
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.
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
I am new to ionic and android development.I have created a sample HelloWorld application which works fine in the browser when I try to generate the unsigned APK I am facing the following issues Build Issue Ionic Image Link.I have installed latest android SDK via android studio.These are the screenshots of installed SDKs Installed SDKs Image Link.I have also tried to modify the environment variable Android_Home path to 'C:\Program Files (x86)\Android\android-sdk\build-tools'.Still facing the same issue.
FYI: I am using Windows as my development environment.
Ionic thinks your Android SDK is at the file path 'C:/Android' because it found adb there. It's definitely not there because 'platform-tools' isn't there. Try deleting that file (or folder if you don't need it) and changing your ANDROID_HOME path variable to the location that Android Studio says your SDK is at. If you navigate to that folder yourself you should see a 'platform-tools' folder there.
I want develop mobile app with Cordova.
I installed Cordova and Android SDK but I have a problem.
I created new project but I didn't add android platform at this project.
Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.
I edited .bashrc and .profile files but my problem is go over.
I am trying to add android as a cordova platform so that I can build apps with phonegap. When I tried to add android thus:
cordova platform add android
I received this error message:
Error: The command "android" failed. Make sure you have the latest Android SDK installed, and the "android" command (inside the tools/ folder) is added to your path.
I do have the latest Android SDK installed and just modified the bash profile by adding this:
export PATH=${PATH}:/Development/adt-bundle/sdk/platform-tools:/Development/adt-bundle/sdk/tools
For some reason when I run "cordova platform add android" I am still getting this error?
Your SDK is not being detected or you have an outdated version.
Ensure you have updated your SDK.
Open another Terminal.