升级 Gradle 版本(Gradle 6.7 或更高版本)并重新构建项目。
在项目的 build.gradle 文件中,将 Bintray 的仓库地址替换为其他可用的仓库地址,比如 JCenter 或者 Maven Central。
例如:
repositories {
google()
jcenter() // 替换成 JCenter 或 Maven Central
}
如果项目中有直接依赖 Bintray 的库,需要将其依赖的仓库地址替换成其他可用的地址,比如 JCenter 或者 Maven Central。
例如:
dependencies {
implementation 'com.example:library:1.0.0' // 依赖的库
}
将依赖的库的仓库地址修改为:
repositories {
google()
jcenter() // 替换成 JCenter 或 Maven Central
}
dependencies {
implementation 'com.example:library:1.0.0' // 依赖的库
}
如果项目中依赖的库没有在其他可用的仓库中,并且 Bintray 仓库已经停止服务,可以手动下载依赖库并将其放到本地仓库中。
例如,手动下载并放到本地仓库:
wget https://dl.bintray.com/cn/xxxx/xxx/xxx-1.0.0.aar -P ~/.m2/repository/cn/xxxx/xxx/
然后在项目中的 build.gradle 文件中添加本地仓库地址:
repositories {
mavenLocal()
google()
jcenter() // 替换成 JCenter 或 Maven Central
}
最后修改依赖库地址为本地仓库地址:
dependencies {
implementation 'cn.xxxx:xxx:1.0.0@aar' // 依赖的库
}