I am trying to add the buildinfo Cordova plugin to my project, to which I have added an Android platform. I was able to add rest of the required Cordova plugins.
Does it have anything to do with my Android version (6.4.0)?
Also, after running command cordova plugin add cordova-plugin-buildinfo, it shows the attached screen but the buildinfo plugin folder along with the required contents gets created at my project's Plugins folder, but not inside the Plugins folder of the Android Platform inside my Cordova project.
Plugins Folder contents
Also kindly note that I have set my ANDROID_HOME and Path environment variables as seen in the below pictures:
P.S. I am able to add the mentioned plugin to another Cordova project in my system!
Your Android_Home environment variable is not set correctly or not set at all due to which this plugin is not able to install. Please make sure that Android_Home environment variable is set correctly.
For Windows:
set ANDROID_HOME=C:\installation location\android-sdk
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
For how to set Android_Home on windows machine, have a look here
The error message makes it sound like you may need to install the platform-tools in Android Studio's SDK Manager. To install them, follow these steps:
Open Android Studio
Tools -> SDK Manager
You should see a list of SDK Platforms in a new popup window, click on the SDK Tools tab
Check Android SDK Tools and hit Apply
That will install the latest version of the Android SDK Tools and hopefully will clear out your error message.
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 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.
Appcelerator Studio 4.7.1.201609100950 on Mac OS X cannot find Android SDK. I have downloaded it with the button on the Appcelerator Studio Dashboard. After download was successfully finished, the Appcelerator Studio was not able to recognise it.
I was getting the following error : [Android SDK Home] No Android SDKs were found under the specified SDK location
I had this issue as well. The reason is (for me at least) is when I first created the App, it was with an older version of Studio & SDK.
One solution, is create a new Project with the latest SDK & Studio, then paste all your code in that new project (make sure everything is updated correctly in tiapp.xml), then you will see there is no more issues running Android.
You can also try it with just a new Mobile Project (with latest SDK, currently 5.5.1.GA), and see if it runs on Android. If this works, you can move all your code to this new project.
Did you try this:
To use the Android SDK with Studio, the path to the SDK must be set in the Preferences dialog.
Open the Preferences dialog:On Mac OS X, from the menu bar, select Appcelerator Studio > Preferences.
In the Preferences dialog, navigate to Studio > Platforms > Android.
Enter the path to your Android SDK in the [Android SDK Home] textbox by clicking Browse then navigate to the SDK directory.
The Android SDK will be found in the Library folder...something like /Users//Library/android-sdk
You did install the android-sdk right!?
What happens from command line when you run appc ti info -t android?
Also, check your Android SDK setting in appc ti config as well as check to see if you've set an environment variable in
/~/.bash_profile called ANDROID_SDK
, and if so that it matches the correct current location of the SDK
If you can't solve this try to change your sdk directory and change it in appcelerator too.
Hope that will help you.
I personally store my SDK and NDK in
/opt/android-sdk
and
/opt/android-ndk
with links in the .bash_profile
export ANDROID_SDK=/opt/android-sdk
export ANDROID_NDK=/opt/android-ndk
finally, use appc ti setup android to set the paths there as well. Both Studio and CLI will pick it up properly from there. Thx!
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