无法解决:com.google.android.gms:play-services:15.0.1 [英] Failed to resolve: com.google.android.gms:play-services:15.0.1
问题描述
在同步gradle时出现以下错误,我检查了与类似问题相关的其他答案,并按照他们的答案进行操作,但仍然收到相同的错误
Getting the following error while sync gradle, I checked other answers related to similar questions and followed their answers but still getting the same error
无法解决:com.google.android.gms:play-services:15.0.1 安装存储库并同步项目在文件中显示在项目中显示 结构对话框
Failed to resolve: com.google.android.gms:play-services:15.0.1 Install Repository and sync project Show in File Show in Project Structure dialog
当我单击安装存储库并同步项目"时,出现以下错误
When I click "Install Repository and sync project" then I get following error
找不到依赖项"com.google.android.gms:play-services:15.0.1"
Could not find dependency "com.google.android.gms:play-services:15.0.1"
以下是应用级别的奖励
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "mpathak.drivetestapp"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
java.srcDirs = ['src/main/java', 'src/main/java/Entities', 'src/main/java/mpathak.drivetestapp', 'src/main/java/mpathak.drivetestapp/interfaces', 'src/main/java/interfaces']
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation 'com.google.dagger:dagger:2.6'
annotationProcessor 'com.google.dagger:dagger-compiler:2.6'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.android.gms:play-services-drive:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services:15.0.1'
implementation 'com.google.android.gms:play-services-identity:15.0.1'
}
和我的模块gradle(顶级)如下
and my module gradle (top-level) is as follows
buildscript {
repositories {
jcenter()
maven {url "https://maven.google.com"}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {url "https://maven.google.com"}
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我遵守约定,如
https://developers.google.com/android/guides/setup
推荐答案
尝试不使用此implementation "com.google.android.gms:play-services:15.0.1"
但具体的库如
implementation "com.google.android.gms:play-services-gcm:15.0.1"
这篇关于无法解决:com.google.android.gms:play-services:15.0.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!