我想使用以下链接作为库:
https://github.com/florent37/MaterialViewPager
我已在gradle
添加了该库,但我收到此错误消息:
Failed to resolve: com.github.florent37:materialviewpager:1.2.0
我的gradle
:
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url 'http://repo1.maven.org/maven2' }
mavenCentral()
jcenter()
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile ('com.github.florent37:materialviewpager:1.2.0@aar'){
transitive = true
}
更新
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
} }
allprojects {
repositories {
mavenCentral()
} }
task clean(type: Delete) {
delete rootProject.buildDir }
答案 0 :(得分:0)
尝试替换
compile ('com.github.florent37:materialviewpager:1.2.0@aar'){
transitive = true
}
用这个
compile 'com.github.florent37:materialviewpager:1.2.0'
答案 1 :(得分:0)
在app / build.gradle中删除此行
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url 'http://repo1.maven.org/maven2' }
mavenCentral()
jcenter()
}