Reputation: 55
I've seen this question asked and replies along the lines of re-syncing the project and updating the SDK
. I am right at the beginning of a new project and trying to set up authentication with firebase
and I'm getting the following errors
Does android studio just hate me?
Error:Failed to resolve: com.google.firebase:firebase-core:11.0.0 Open File
Show in Project Structure dialog Error:Error:line (29)Failed to resolve: com.google.firebase:firebase-auth:11.0.0 Show in File
Show in Project Structure dialog
Upvotes: 4
Views: 5628
Reputation: 1
for android studio 4.1.2.
NB/classpath 'com.google.gms:google-services:4.3.5'
apply plugin: 'com.google.gms.google-services'
if it was helpful leave a comment.
Upvotes: 0
Reputation: 149
lines order is very importance for the Gradle.
1) buildscript { ext.kotlin_version = '1.2.20'
repositories {
maven { url "https://maven.google.com" }
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'//3.2.0
classpath 'com.google.firebase:firebase-plugins:1.0.4'
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.8.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
and
2)
dependencies {
compile project(':libraries')
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
//--------------------------------- One Signal-------------------
//compile 'com.onesignal:OneSignal:[3.1.1, 3.3.99]'
compile 'com.google.android.gms:play-services-gcm:11.0.4'
compile 'com.google.android.gms:play-services-location:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-messaging:11.0.4'
//-------------------------------------------------------------
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:percent:26.0.0-alpha1'
compile 'com.android.support:design:26.0.0-alpha1'
compile 'com.android.support:support-v4:26.0.0-alpha1'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
apply plugin: 'com.google.gms.google-services'
good luck
Upvotes: -2
Reputation: 339
Make sure that your project level build.gradle file have these:
allprojects {
repositories {
jcenter()
mavenLocal()
maven { url 'https://maven.google.com' }
}
}
Upvotes: -1
Reputation: 55
I was able to resolve this by using 10.0.0
Thanks all for your help
Nick
Upvotes: 1
Reputation: 12021
Go to Tools > Android > SDK Manager click on SDK Tools and update the following:
Upvotes: 10
Reputation: 11
you can only click on AddAnalytics to your app follow this https://firebase.google.com/docs/android/setup
Upvotes: 1