Flutter 出現Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.15)

在一次代碼拉取中,出現了以下問題:Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.15)

詳細的報錯信息如下:

// 報錯信息如下
Could not resolve all files for configuration ':jcore-react-native:lintClassPath'.
> Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.15)
   > Could not get resource 'https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar'.
      > Could not GET 'https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar'.
         > Remote host closed connection during handshake
> Could not download trove4j.jar (org.jetbrains.trove4j:trove4j:20160824)
   > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar'.
      > Could not GET 'https://jcenter.bintray.com/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar'.
         > Connection reset

不能下載該包名,這種情況在國內很常見,一般出現的情況有:

  1. 網絡不好(恰好家裏的網絡不好,也就更容易出現這種情況)
  2. 網絡被強了(因爲你在天朝)

解決辦法(用國內的鏡像)

具體的操作如下:

//        google()
//        jcenter()
  maven { url 'https://maven.aliyun.com/repository/google'}
        maven { url 'https://maven.aliyun.com/repository/jcenter'}
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public'}

google、jcenter的鏡像源改爲阿里雲的,如下圖。
在這裏插入圖片描述
附:有時候還不行的話,這時候的你可能需要開熱點進行下載了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章