【发布时间】:2018-03-15 13:38:28
【问题描述】:
我想添加这些依赖项:
implementation 'com.andrognito.pinlockview:pinlockview:2.1.0'
implementation 'com.multidots:fingerprint-auth:1.0.1'
在带有 gradle 3.0.1 的 android studio 3.0.1 中,但出现以下错误:
无法解析 ':app@debug/compileClasspath' 的依赖关系:无法解析 com.multidots:fingerprint-auth:1.0.1。 无法解析 ':app@debugAndroidTest/compileClasspath' 的依赖关系:无法解析 com.andrognito.pinlockview:pinlockview:2.1.0。
我的build.gradle 文件是:
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
还有一个:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.b.jacob.gallery"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:24.2.1'
implementation 'com.android.support:design:24.2.1'
implementation 'com.andrognito.pinlockview:pinlockview:2.1.0'
implementation 'com.multidots:fingerprint-auth:1.0.1'
testImplementation 'junit:junit:4.12'
}
重要的是说这些依赖关系在旧版本的 android studio 中解决没有任何问题。
【问题讨论】:
-
你能不能先用谷歌改变 jcenter(),mavenCentral(),google() 存储库的顺序
标签: android android-gradle-plugin