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

在使用Flutter时遇到无法下载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的镜像源改为阿里云的,如下图。
在这里插入图片描述
附:有时候还不行的话,这时候的你可能需要开热点进行下载了。

评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值