mark_97
mark_97

Reputation: 317

Gradle using terminal with Android Studio install on Ubuntu 12.04

Can not get the terminal commands to work with gradle. I am trying to get Gradle to work outside of Android Studio as a prelude to scripting up various flavors of my app. I got the flavors to build within Android Studio but I find the interface confusing.

Gradle was installed either with ADT or Android Studio at: /home/mark/.gradle

Would like to use the install of Gradle at /home/mark/.gradle. Would like to avoid the Gradle in the repo since Android Studio updates frequently and their a possibility that I could wind up with two different versions of Gradle that could cause more headaches.

So far I have tried setting the PATH various ways in .bashrc bash.bashrc environment files. Nothing worked.

Not sure if I put the wrong terms/commands in those files or the files are wrong ones. Tried the gradle term with and with out the dot as well. I would appreciate explicit instructions on terms/commands and in what files.

Upvotes: 1

Views: 2370

Answers (1)

ben75
ben75

Reputation: 28726

The gradle executable is usually installed here (when installed by by android-studio):

<user_home>/.gradle/wrapper/dists/gradle-<version>-bin/<some_key>/gradle-<version>/bin/

So be sure that your PATH variable include this path.

Alternativelly, you can download the gradle distribution, unzipping it in a more convenient location and use that location in your PATH.

Wathever your choice is (i.e. using the gradle installed by Android-Studio or download and install a distribution of gradle yourself) : you have to take care to maintain your PATH variable up-to-date when you install a newer version of Android-Studio.

Upvotes: 3

Related Questions