Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does gradle save dependencies' jars?

I want to look at the jars/aars that are compiled when I add dependencies.

For example if I add this dependency in Gradle, where does it put the jar?

dependencies {     compile 'com.google.android.gms:play-services-analytics:11.0.4' } 
like image 520
Doron Yakovlev Golani Avatar asked Oct 19 '17 14:10

Doron Yakovlev Golani


People also ask

Where does Gradle store dependency jars?

Gradle declares dependencies on JAR files inside your project's module_name /libs/ directory (because Gradle reads paths relative to the build.gradle file). This declares a dependency on version 12.3 of the "app-magic" library, inside the "com.example.android" namespace group.

What is Gradle cache directory?

The Gradle Build Cache is designed to help you save time by reusing outputs produced by previous builds. It works by storing (locally or remotely) build outputs, and allowing builds to fetch these outputs from the cache when it determines that inputs have not changed.

Where do Gradle build files go?

gradle file is located inside your project folder under app/build.

Where is .Gradle folder located?

gradle folder location for Android studio, you must: Define the GRADLE_USER_HOME environment variable to point to C:\WorkFolder\ . gradle.


2 Answers

BY DEFAULT

Linux:

~/.gradle/caches/modules-2/files-2.1 

Windows:

%USERPROFILE%/.gradle/caches/modules-2/files-2.1 

Mac:

~/.gradle/caches/modules-2/files-2.1 

Android:

no idea... can anyone edit? 

SETTING TO SOMETHING ELSE

But you can override these default settings by setting GRADLE_USER_HOME. The latter environment variable, if set, is NOT the same as GRADLE_HOME, which is the path to the directory containing the bin/ directory for the Gradle version your system is using at the command prompt (NB instead of invoking Gradle directly at the command line most people seem to use the Gradle wrapper however: $ ./gradlew build).

RUNNING GRADLE IN AN IDE

IDEs may be using a different version and be storing dependency jars somewhere else. I only know Eclipse. Having installed Buildship ("Eclipse Plug-ins for Gradle") the place to go is Window --> Preferences --> Gradle. There is a box here for you to specify "Gradle User Home". Mine is currently empty. I presume it is using the system GRADLE_USER_HOME (which I have indeed set)... but I haven't bothered checking: although it is possible to run Gradle tasks from within Eclipse to me it is more handy to run Gradle commands in a separate Terminal (*nix)/Command Prompt window ('Doze).

like image 135
mike rodent Avatar answered Oct 04 '22 15:10

mike rodent


Generally, you can find in:

%USERPROFILE%/.gradle/caches/modules-2/files-2.1 
like image 36
FabioLux Avatar answered Oct 04 '22 16:10

FabioLux