Cordova installation error - android

Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
Although I have installed android-studio but is stored on my desktop.

If you have android studio installed then you might want to try:
export PATH="$PATH:/home/<username>/android-studio/gradle/<gradle-4.0>/bin"
check this question

Related

Could not find an installed version of Gradle either in Android Studio, or on your system to install the gradle wrapper

I was installing android studio 3.5.1 after installing the latest one while trying to run my CORDOVA android application I got below Error:
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=D:\Software\sdk (DEPRECATED)
Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
Kindly help out this problem I am new to Cordova app development
What is the output of the gradle -v command? To properly install Gradle you need to create/edit the CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL environment variable with the location of a Gradle distributable ZIP.
Check out this guide to install Gradle for more details.

Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK. Cordova

I am trying to build android project based on Cordova but I have error as follows:
Error: Could not find gradle wrapper within Android SDK. Might need to
update your Android SDK.
I am using cordova 6.4.0.
Please help me to solve this issue.
Actually, there is an issue where who are using Cordova older versions(eg. Cordova 6.4.0), From android SDK Tools, Revision 25.2.3 (November 2016) onwards they have removed templates folder from the tools which are required to create build till cordova-android#6.2.2.
Use following steps it will help you,
Download the tools_r25.2.3-macosx.zip/tools_r25.2.3-windows.zip from here
Extract the zip
Go to Android SDK path then go to in your tools folder
Replaced ..\AppData\Local\Android\sdk\tools with extracted sub-folder of tools/ (templates folder)
And now do the build process again, your issue will be resolved.
$ cordova build android / cordova run android
Also please check the similar type of question from here.
Hopes this will help you !!
just execute the following commands.
npm install -g cordova;
cordova platform rm android;
cordova platform add android;
It will update you cordova to latest version and remove and add the platform newly.
Thanks
Solution for above question
Those who are using cordova older versions(eg. cordova 6.4.0), i.e. Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK so solution for this is as follows
Download the tools_r25.2.3-macosx.zip from https://developer.android.com/studio/releases/sdk-tools.html link
Extract it and copy the templates folder from it
Go to android sdk path then go in tools folder
Paste the templates folder here
And now do the build process again, your issue will be resolved.
Why this issue From SDK Tools, Revision 25.2.3 (November 2016) onwards they have removed templates folder from the tools which is required to create build till cordova-android#6.2.2.

Update cordova-android 6.3.0->6.4.0 => Gradle not found

I upgraded from cordova-android 6.3.0 to 6.4.0 and also updated Android Studio from 2.3 to 3.0.0 (http://cordova.apache.org/announcements/2017/11/09/android-release.html)
At cordova build time, I'm no facing the error:
ANDROID_HOME=/Users/me/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
Error: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
Any ideas?
Thx solution was found by #Sujan12 on the Ionic Framework forum.
Furthermore to the updates of the Android libs, I had to install locally Gradle (https://gradle.org/install/).
(be sure to modify the PATH variable permanently after Gradle install)
Once this done, I was able to build my app again
https://forum.ionicframework.com/t/solved-update-cordova-android-6-3-0-6-4-0-gradle-not-found/112123/4

Error when building android APK

I have Android-studio 2.3.2 (which is android-studio-ide-162.3934792-linux.zip) installed, which is the latest stable version. I am using fedora 24. I am using meteor 1.4.4.2
When I build an APK using "meteor build" I get this error:
While building Cordova app for
platform Android: Could not find gradle wrapper within Android SDK.
Might need to update your Android SDK. Looked here: ~/Android/Sdk/tools/templates/gradle/wrapper
It seems to me the path to gradle wrapper has changed on the latest version of Android-studio. I don't have a previous version of Android-studio to prove this though. I've searched for previous versions of Android-studio and could not find them. I have searched for a solution but there is no one out there who seems to be solving this issue.
You will find a solution in this other thread and some explanation in this answer
The explanation is that the linux version of cordova does not search for gradle in the Android studio install folders like for Windows (and even for windows it does not find it if android studion is not installed in c:\program files\android\android studio) or Mac .
On Linux (and maybe for Mac&Windows in future versions of Cordova), you have to install a version of gradle and add it to your path (way to install gradle depends on the version of Linux you're using)
The behaviour was different in the past because android sdk was not inside Android studio like it is now. You could find gradle in the ANDROID_HOME/tools folder.
With recent upgrades, Android SDK structure has changed and it is now part of android studio.
Installing android-sdk_r24.4.1-linux.tgz which installs version 25 or higher version by default solved the problem for me. Because I could not find a way to uninstall Android Studio I had to uninstall and re-install my linux.
See https://gist.github.com/rolandboon/0a5abe1d9c6c515c59ec for downloading and installing the sdk

ionic run android error: Could not find an installed version of gradle either in android studio

I got this error when i run ionic run android in my ionic 3 app console.
I saw many posts of it in stack over flow but nothing solve my issue.
ANDROID_HOME=C:\Users\XXXX\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_101
Error: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
I had same issue with cordova app (not ionic 3). I uninstalled sdk android and I installed Android Studio and now it works.

Categories

Resources