Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle dependencies resolving suddenly extremely slow

I am developing Android project with Android Studio and gradle. Till yesterday, gradle build was building relatively fast in a few seconds. Since today, it suddenly became 5 minutes per build.

I gave bigger size on gradle VM but still has no hope.

Could anyone give me any tips what is going on and how to solve this?

Android Studio: 0.4.6 Gradle: 1.9

enter image description here

build.gradle

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.3+'
    }
}

apply plugin: 'android'

repositories {
    maven {
        url 'https://github.com/Goddchen/mvn-repo/raw/master/'
    }
    mavenCentral()
}

dependencies {
    compile 'com.android:volley:1.0'
    compile 'com.android.support:support-v13:13.0.+'
                .....
}
like image 344
Emma Avatar asked Mar 21 '14 05:03

Emma


People also ask

How does Gradle resolve dependencies?

Given a required dependency, with a version, Gradle attempts to resolve the dependency by searching for the module the dependency points at. Each repository is inspected in order. Depending on the type of repository, Gradle looks for metadata files describing the module (.module,.pom or ivy.xml file) or directly for artifact files.

How many Gradle builds hang after update to Android Studio?

16 Gradle build hangs after update to Android Studio 1.3 9 Gradle cannot resolve dependencies in Android Studio 4 Slow build gradle in android 0 Android speed up launching application Related 751 Gradle build without tests

How do I declare a groovy dependency in Gradle?

Gradle TestKit dependencies The TestKit chapter explains the use of TestKit by example. You can declare a dependency on the Groovy that is distributed with Gradle by using the DependencyHandler.localGroovy () method. This is useful when you are developing custom Gradle tasks or plugins in Groovy. Example 15. Gradle’s Groovy dependencies

How to improve Gradle performance?

If this is not enough for you, take a time testing the options on the Gradle > Experimental ... Some options may improve you performance: Note: In newer version of Android studio, View->Tool Windows->Gradle->Toggle button of online/offline Share Follow edited Oct 28 '20 at 16:30 Uddhav P. Gautam


2 Answers

If you are using Android Studio with gradle, for the time being doing

go to android studio -> preferences -> compiler -> gradle -> check offline mode

has improve my build times drastically. Since, I already have latest libraries cached it works

well.

like image 117
Laimiux Avatar answered Sep 19 '22 19:09

Laimiux


I have same problem too and i contacted my provider which tracked trace to www.mvnrepository.com (repository for dependencies) and trace will end on ec2-79-125-0-137.eu-west-1.compute.amazonaws.com [79.125.0.137]

Problem is on amazonaws.com. Here is trace route:

1 < 1 ms < 1 ms < 1 ms private.rionet.cz [172.25.20.1]
2 10 ms 10 ms 9 ms private.rionet.cz [172.28.0.1]
3 11 ms 10 ms 10 ms rio-bb-jsw01-vlan-4050-94-74-192-164.net.rionet.
cz [94.74.192.164]
4 11 ms 10 ms 10 ms sitK9-bb-jsw01-xe-0-1-2-0-188-175-255-85.net.rio
net.cz [188.175.255.85]
5 10 ms 9 ms 10 ms sitK9-bb-jrt01-xe-9-0-0-0-188-175-255-197.net.ri
onet.cz [188.175.255.197]
6 68 ms 10 ms 9 ms prag-b3-link.telia.net [213.248.87.97]
7 15 ms 17 ms 17 ms win-bb2-link.telia.net [213.155.131.68]
8 34 ms 34 ms 34 ms hbg-bb2-link.telia.net [62.115.136.30]
9 92 ms 154 ms 47 ms ldn-bb2-link.telia.net [80.91.247.169]
10 65 ms 64 ms 85 ms dln-b1-link.telia.net [213.155.136.121]
11 70 ms 55 ms 64 ms amazon-ic-300342-dln-b1.c.telia.net [80.239.128.
18]
12 65 ms 64 ms 64 ms 178.236.0.126
13 64 ms 71 ms 64 ms 178.236.0.125
14 66 ms 57 ms 57 ms ec2-79-125-0-137.eu-west-1.compute.amazonaws.com
[79.125.0.137]
15 * * * Vypršel časový limit žádosti.
16 * * * Vypršel časový limit žádosti.
17 * * * Vypršel časový limit žádosti.
18 * * * Vypršel časový limit žádosti.
19 * * * Vypršel časový limit žádosti.
20 * * * Vypršel časový limit žádosti.
21 * * * Vypršel časový limit žádosti.
22 * * * Vypršel časový limit žádosti.
23 * * * Vypršel časový limit žádosti.
24 * * * Vypršel časový limit žádosti.
25 * * * Vypršel časový limit žádosti.
like image 41
Vanama Avatar answered Sep 19 '22 19:09

Vanama