I have installed cordova and android sdk on linux mint 17, and downloaded gradle 2.4 (bin) and extracted it and set path to it, now I can get gradle -v from terminal, its ok, but when i want to build cordova :
cordova build
it starts to download gradle 2.2....
how i can set it to use current gradle 2.4 insteed downloading older version?
gradle -v
------------------------------------------------------------
Gradle 2.4
------------------------------------------------------------
Build time: 2015-05-05 08:09:24 UTC
Build number: none
Revision: 5c9c3bc20ca1c281ac7972643f1e2d190f2c943c
Groovy: 2.3.10
Ant: Apache Ant(TM) version 1.9.4 compiled on April 29 2014
JVM: 1.7.0_79 (Oracle Corporation 24.79-b02)
OS: Linux 3.13.0-24-generic i386
I had figured out the reason:
See the code
GradleBuilder.prototype.prepEnv
in $PROJECT_ROOT/platforms/android/cordova/lib/builders/GradleBuilder.js。A quick fix :
Notice:
$USER_HOME/.gradle/wrapper/dists/gradle-2.4-all/5i28vc5j9c3ssbtreg4518ujvp/gradle-2.4
.export
command must always be executed before run cordova.If the network is slow, you download gradle-2.2.1-all.zip manually, then use this method once.
Also, you can change GradleBuilder.js's code or request a enhancement/issue.
Window, Linux & MacOS users - Install Gradle manually
Step 1.
Download the latest Gradle distributionStep 2.
Unpack the distribution Create a new directoryC:\Gradle
with File Explorer.Open a second File Explorer window and go to the directory where the Gradle distribution was downloaded. Double-click the ZIP archive to expose the content. Drag the content folder
gradle-[VERSION] to
your newly created C:\Gradle folder.Alternatively you can unpack the Gradle distribution ZIP into C:\Gradle using an archiver tool of your choice.
Step 3.
Configure your system environmentConfigure your PATH environment variable to include the bin directory of the unzipped distribution, e.g.:
In File Explorer right-click on the This PC (or Computer) icon, then click Properties -> Advanced System Settings -> Environmental Variables.
Under System Variables select Path, then click Edit. Add an entry for
C:\Gradle\gradle-4.1\bin
. Click OK to save.Step 4.
Verify your installationOpen a console (or a Windows command prompt) and run below command to run Gradle and display the version, e.g.:
OutPut
Read - For More
Hope this will be a help for all! :)