[英]Androidstudio can not resolve dependencies after adding classpath 'com.google.gms:google-services:1.5.0-beta2'
[英]Could not resolve com.google.gms:google-services:3.0.0
我阅读了很多关于这个主题的帖子,但没有人帮助我。 我正在使用 Android Studio 并遵循本指南
这是项目gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
这是应用程序gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.xyv.appname"
minSdkVersion 15
targetSdkVersion 25
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(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:design:25.0.1'
testCompile 'junit:junit:4.12'
compile 'com.google.firebase:firebase-core:10.0.1'
}
apply plugin: 'com.google.gms.google-services'
在这里您可以看到我在应用程序中添加 google-services.json 的位置:
这些是我的 SDK 工具:
有人明白我的错误是什么吗?
先感谢您
您可能需要添加
compile 'com.google.android.gms:play-services:9.6.1'
在您的应用程序 build.gradle 中。 参考: 升级到 Google Play 服务:9.0.0 错误无法解决:com.google.android.gms:play-services-measurement:9.0.0
如果您最近将版本提高到 3.0.0,您应该在 Android SDK 管理器中仔细检查您的机器上是否安装了正确的版本。
我通过将 android studio 更新到 2.3 beta 2 解决了我的问题我只是更新了一个 android studio,一切都在破坏
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.