Reputation: 77
I am attempting to follow the instructions at https://developers.google.com/identity/sign-in/android/start-integrating to create a Google sign in button for my application. However, when I try to use
compile 'com.google.android.gms:play-services-auth:11.6.2'
I get the error "Could not find com.google.android.gms:play-services-auth:11.6.2". I have followed the advice of similar questions and have made sure that my SDK is up to date but no luck.
The project build:
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" }
}
}
And the app build:
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'
}
Any suggestions? Thanks,
Ian
Upvotes: 1
Views: 6208
Reputation: 447
just update com.android.support to version 25.4.0 in your app gradle
Upvotes: 0
Reputation: 3783
Just add google() to your gradle repositories list, this is where version 11.6.2 is found for now. Something like that:
allprojects {
repositories {
jcenter()
google()
maven { url 'https://jitpack.io' }
}
}
Upvotes: 1
Reputation: 423
In order to use compile 'com.google.android.gms:play-services-auth:11.6.2' you should do the following steps.
1) Inside your build.gradle (module) replace:
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'
with:
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:design:25.4.0'
compile 'com.android.support:cardview-v7:25.4.0'
2) Inside your build.gradle (project) you should replace:
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" }
}
}
with:
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
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
google()
}
}
Upvotes: 3
Reputation: 35
Try this:
menu: Tools, Android, Sdk Manager
check: Show Package Details
Install Android SDK plataform 27
Ok. Add marven when Android Studio ask at messages log errors just clicking in it.
change this lines from 25 or 26 to 27
compileSdkVersion 27
targetSdkVersion 27
now is working.
Upvotes: 0
Reputation: 4220
the Latest version of play-services-auth
compile 'com.google.android.gms:play-services-auth:11.6.0'
just change it in Your Gradle.Build
there is no dependency like compile 'com.google.android.gms:play-services-auth:11.6.2'
for more information read from
Start Integrating Google Sign-In into Your Android App
Upvotes: 3