问题:同步依赖包后报错Failed to resolve: com.github.GinRyan:NTabLayout:0.3.4
解决:maven放错位置了
方法:
gradle 7.0之前
在project: build.gradle中加入
allprojects {
repositories {
google()
jcenter()
maven {
url "https://jitpack.io"
}
}
}
注意:maven {url "https://jitpack.io"} 是加在allprojects中的
gradle 7.0 之后
如果用上面的方法会报
Build was configured to prefer settings repositories over project repositori的错误
不用配置project: build.gradle
在 setting.gradle(Project settings) 中增加maven {url "https://jitpack.io"}
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
repositories {
maven { url "https://jitpack.io" }
}
}
参考:
https://blog.csdn.net/haijie_liu/article/details/90896111
https://blog.csdn.net/jian11058/article/details/116652630