【发布时间】:2017-11-09 04:56:57
【问题描述】:
我正在尝试按照https://developers.google.com/identity/sign-in/android/start-integrating 的说明进行操作 为我的应用程序创建一个 Google 登录按钮。但是,当我尝试使用时
compile 'com.google.android.gms:play-services-auth:11.6.2'
我收到错误消息“找不到 com.google.android.gms:play-services-auth:11.6.2”。我遵循了类似问题的建议,并确保我的 SDK 是最新的,但没有运气。
项目构建:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
}
}
应用构建:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "theproject.theapp"
minSdkVersion 19
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.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.google.android.gms:play-services-auth:11.6.2'
compile 'com.google.android.gms:play-services-maps:9.0.0'
compile 'com.google.maps:google-maps-services:0.1.20'
compile 'com.lorentzos.swipecards:library:1.0.9'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.makeramen:roundedimageview:2.3.0'
compile 'com.facebook.android:facebook-login:[4,5)'
testCompile 'junit:junit:4.12'
}
有什么建议吗?谢谢,
伊恩
【问题讨论】:
-
尝试从 android sdk manager 更新 google play 服务。
-
@ihunter2839 看看stackoverflow.com/questions/37310188/…
-
@HemantParmar 没有像
compile 'com.google.android.gms:play-services-auth:11.6.2'这样的依赖关系
标签: android gradle google-authentication