Building and running app via Gradle and Android Studio is slower than via Eclipse

前端 未结 28 2528
太阳男子
太阳男子 2020-11-22 08:21

I have a multi-project (~10 modules) of which building takes about 20-30 seconds each time. When I press Run in Android Studio, I have to wait every time to rebuild the app,

28条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 08:42

    I'm far from being an expert on Gradle but my environment had the following line in .gradle/init.gradle

    gradle.projectsLoaded {
        rootProject.allprojects {
            repositories {
                mavenRepo name: 'libs-repo', url: 'http://guest-vm/artifactory/repo'
            }
        }
    }
    

    Yet I have no idea why that line was there, but I try changing to

    gradle.projectsLoaded {
        rootProject.allprojects {
            repositories {
                mavenCentral()
            }
        }
    } 
    

    and now I finally can work without swearing to Android Studio & Gradle buildind scheme.

提交回复
热议问题