Huawei mobile services 连接HMS Core后,Android Studio项目同步缓慢

Huawei mobile services 连接HMS Core后,Android Studio项目同步缓慢,huawei-mobile-services,Huawei Mobile Services,我已经配置了Google和center Maven存储库。但这表明它们没有配置,我该怎么办?在您描述的情况下,项目的所有依赖项包将首先同步到华为的Maven存储库。因此,同步速度较慢。 如果发现项目同步缓慢,请按以下顺序配置Maven存储库: buildscript { repositories { google() jcenter() maven { url 'http://developer.huawei.com

我已经配置了Google和center Maven存储库。但这表明它们没有配置,我该怎么办?

在您描述的情况下,项目的所有依赖项包将首先同步到华为的Maven存储库。因此,同步速度较慢。 如果发现项目同步缓慢,请按以下顺序配置Maven存储库:

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'http://developer.huawei.com/repo/'
        }
    }
}
allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'http://developer.huawei.com/repo/'
        }
    }
}

拥有一个单独的存储库部分将有助于加快构建速度

allprojects {
    repositories {
        google()
        jcenter()
    }
    repositories {
        maven {
            url 'http://developer.huawei.com/repo/'
        }
    }
}

您可以通过指定maven的组来加快速度。将此maven添加为
gradle.properties
中的最后一个源:

maven {
    url 'http://developer.huawei.com/repo/'
    content {
        includeGroup "com.huawei"
        includeGroup "com.huawei.hms"
        includeGroup "com.huawei.agconnect"
        includeGroup "com.huawei.hmf"
    }
}
结果将是:

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'http://developer.huawei.com/repo/'
            content {
                includeGroup "com.huawei"
                includeGroup "com.huawei.hms"
                includeGroup "com.huawei.agconnect"
                includeGroup "com.huawei.hmf"
            }
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.3'
        classpath 'com.huawei.agconnect:agcp:1.2.0.300'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'http://developer.huawei.com/repo/'
            content {
                includeGroup "com.huawei"
                includeGroup "com.huawei.hms"
                includeGroup "com.huawei.agconnect"
                includeGroup "com.huawei.hmf"
            }
        }
    }
}
请说得更具体些。