Flutter和Android中覆盖gradle中的repositories仓库地址

解决Flutter依赖下载失败
本文介绍了解决Flutter项目中依赖库下载失败的问题,通过修改项目的仓库地址为国内镜像源,确保了第三方库能正常下载。

覆盖Android三方库的仓库地址

问题场景

flutter中使用了一个定位权限库location_permissions,运行发现报以下错误。

* What went wrong:
A problem occurred configuring project ':location_permissions'.
> Could not resolve all artifacts for configuration ':location_permissions:classpath'.
   > Could not resolve org.ow2.asm:asm-util:6.0.
     Required by:
         project :location_permissions > com.android.tools.build:gradle:3.5.0
         project :location_permissions > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0
         project :location_permissions > com.android.tools.build:gradle:3.5.0 > com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta04
      > Could not resolve org.ow2.asm:asm-util:6.0.
         > Could not get resource 'https://jcenter.bintray.com/org/ow2/asm/asm-util/6.0/asm-util-6.0.pom'.
            > Could not HEAD 'https://jcenter.bintray.com/org/ow2/asm/asm-util/6.0/asm-util-6.0.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.2/userguide/build_environment.html#gradle_system_properties
                  > Remote host terminated the handshake
> Failed to notify project evaluation listener.
   > Could not get unknown property 'android' for project ':location_permissions' of type org.gradle.api.Project.
   > Could not get unknown property 'android' for project '<
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值