mahmood
mahmood

Reputation: 24765

firebase-core:12.0.1 not found

I have created a firebase project and it says I have to modify the core version to 12 according to the picture

enter image description here

The default code is 9.6.1. So, I changed that number to 12.0.1

compile 'com.google.firebase:firebase-core:12.0.1'

However, the sync failed with the following error

Failed to resolve: com.google.firebase:firebase-core:12.0.1

What should I do?

Upvotes: 5

Views: 4257

Answers (4)

Levi Moreira
Levi Moreira

Reputation: 12005

Update the gms plugin:

classpath 'com.google.gms:google-services:4.0.0' // google-services plugin

and the firebase lib:

 implementation 'com.google.firebase:firebase-core:16.0.0'

Also add google maven to your build.gradle file:

allprojects {
    // ...
    repositories {
        // ...
        maven {
        url "https://maven.google.com" // Google's Maven repository
       }
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

Upvotes: 8

Paraskevas Ntsounos
Paraskevas Ntsounos

Reputation: 1777

For avoid further errors in grandle beacause of a bug try to use:

classpath 'com.google.gms:google-services:3.2.1'

And for firebase use what you need from below:

    implementation 'com.google.firebase:firebase-core:15.0.2'
    implementation 'com.google.firebase:firebase-ads:15.0.1'
    implementation 'com.google.firebase:firebase-analytics:15.0.2'
    implementation 'com.google.firebase:firebase-appindexing:15.0.1'
    implementation 'com.google.firebase:firebase-auth:15.1.0'
    implementation 'com.google.firebase:firebase-firestore:16.0.0'
    implementation 'com.google.firebase:firebase-functions:15.0.0'
    implementation 'com.google.firebase:firebase-messaging:15.0.2'
    implementation 'com.google.firebase:firebase-storage:15.0.2'
    implementation 'com.google.firebase:firebase-crash:15.0.2'
    implementation 'com.google.firebase:firebase-invites:15.0.1'
    implementation 'com.google.firebase:firebase-perf:15.2.0'
    implementation 'com.google.firebase:firebase-database:15.0.1'
    implementation 'com.google.firebase:firebase-config:15.0.2'
  • If you using gogle play-services in your grandle set version to 15.0.0 like below example:

    implementation 'com.google.android.gms:play-services-location:15.0.0'
    implementation 'com.google.android.gms:play-services-maps:15.0.0'
    implementation 'com.google.android.gms:play-services-places:15.0.0'
    implementation 'com.google.android.gms:play-services-gcm:15.0.0'
    

I hope this will help you =)

Upvotes: 0

Kopi Bryant
Kopi Bryant

Reputation: 1364

com.google.firebase:firebase-core:12.0.1 is old version already.

You can try version 15.0.0 or as Levi Albuquerque said 16.0.0

However just to remind you that if you implement more than one same kind of library, they should be always in the same version to avoid any syncing error.

Example

implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.google.firebase:firebase-storage:15.0.0'
implementation 'com.google.firebase:firebase-database:15.0.0' 

All are same version 15.0.0

Upvotes: 2

Grenoblois
Grenoblois

Reputation: 569

You need to add the google() maven inside your allProjects block in your project build.gradle like this:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        ...
    }
}

repositories {
    ...
}

// You need to add the google maven in this block.
allprojects {
    repositories {
        jcenter()
        google()
    }
}

Upvotes: 0

Related Questions