无法确定 com.google.android.gms:play-services-vision:18.0.0 的工件
Could not determine artifacts for com.google.android.gms:play-services-vision:18.0.0
我无法在 Android Studio 中构建我的项目。我正在尝试使用 google 视觉 API 进行人脸检测,到目前为止它工作正常,但由于这个
我无法清理/构建我的项目
这是我的构建错误消息
Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not determine artifacts for com.google.android.gms:play-services-vision:18.0.0
Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-vision/18.0.0/play-services-vision-18.0.0.aar'.
Could not HEAD 'https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-vision/18.0.0/play-services-vision-18.0.0.aar'.
Remote host closed connection during handshake
SSL peer shut down incorrectly
这是我的 build.gradle 文件(应用级别)
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
defaultConfig {
applicationId "com.example.facedetect"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'com.android.volley:volley:1.1.1'
implementation "com.github.bumptech.glide:glide:4.9.0"
implementation 'com.github.bumptech.glide:glide:4.9.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
implementation 'com.google.android.gms:play-services-vision:18.0.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.mindorks:paracamera:0.2.2'
}
apply plugin: 'com.google.gms.google-services'
项目级别build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:4.3.0'
}
}
当我删除
implementation 'com.google.android.gms:play-services-vision:18.0.0
项目构建成功。我添加依赖项的方式有问题吗?
我认为你的依赖类路径有问题。您创建了两个构建脚本依赖项。相反,您可以在同一构建脚本中包含一个或多个插件(依赖项)。
你可以有 root build.gradle 如下:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.3.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
此外,您不必单独编写 google maven url maven { url 'https://maven.google.com'}
,因为 google()
会为您做同样的事情。
我想通了。看来我需要使缓存失效并重新启动 android 工作室和我的电脑。感谢您的帮助!
我无法在 Android Studio 中构建我的项目。我正在尝试使用 google 视觉 API 进行人脸检测,到目前为止它工作正常,但由于这个
我无法清理/构建我的项目这是我的构建错误消息
Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not determine artifacts for com.google.android.gms:play-services-vision:18.0.0
Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-vision/18.0.0/play-services-vision-18.0.0.aar'.
Could not HEAD 'https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-vision/18.0.0/play-services-vision-18.0.0.aar'.
Remote host closed connection during handshake
SSL peer shut down incorrectly
这是我的 build.gradle 文件(应用级别)
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
defaultConfig {
applicationId "com.example.facedetect"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'com.android.volley:volley:1.1.1'
implementation "com.github.bumptech.glide:glide:4.9.0"
implementation 'com.github.bumptech.glide:glide:4.9.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
implementation 'com.google.android.gms:play-services-vision:18.0.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.mindorks:paracamera:0.2.2'
}
apply plugin: 'com.google.gms.google-services'
项目级别build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:4.3.0'
}
}
当我删除
implementation 'com.google.android.gms:play-services-vision:18.0.0
项目构建成功。我添加依赖项的方式有问题吗?
我认为你的依赖类路径有问题。您创建了两个构建脚本依赖项。相反,您可以在同一构建脚本中包含一个或多个插件(依赖项)。
你可以有 root build.gradle 如下:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.3.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
此外,您不必单独编写 google maven url maven { url 'https://maven.google.com'}
,因为 google()
会为您做同样的事情。
我想通了。看来我需要使缓存失效并重新启动 android 工作室和我的电脑。感谢您的帮助!