在project中找到settings.gradle
原先是這樣的程式碼
在pluginManagement中加入
maven(url = "https://maven.aliyun.com/repository/google")
maven(url = "https://maven.aliyun.com/repository/central")
maven(url = "https://maven.aliyun.com/repository/gradle-plugin")
在dependencyResolutionManagement中加入
maven(url = "https://maven.aliyun.com/repository/google")
maven(url = "https://maven.aliyun.com/repository/central")
如圖所示
再次sync時就能成功,如若不成功,可網上繼續查詢,以上僅個人解決方法