react native运行报错Could not resolve com.google.android.gms:play-services-iid:[16.0.1]

在这里插入图片描述

google 自家的 maven 仓库 https://maven.google.com,连接不上。
1. 配置 Gradle Proxy,在 gradle.properties 中添加代理
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=1080
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost

systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=1080
systemProp.https.proxyUser=userid
systemProp.https.proxyPassword=password
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost
2. dl.google.com 局域网可访问

https://maven.google.com 会 301 跳转到 https://dl.google.com/dl/android/maven2/

所以直接替换 https://maven.google.com 为 https://dl.google.com/dl/android/maven2/
在这里插入图片描述

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐