Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 287
mahmood Avatar asked May 24 '18 13:05

mahmood


People also ask

Is firebase core deprecated?

Core. DEPRECATED: FirebaseApp. configure method is now deprecated in favor of the Firebase.

What is firebase app?

Firebase provides detailed documentation and cross-platform SDKs to help you build and ship apps on Android, iOS, the web, C++, and Unity.


2 Answers

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" }
    }
}
like image 57
Levi Moreira Avatar answered Oct 20 '22 01:10

Levi Moreira


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

like image 2
Kopi Bryant Avatar answered Oct 20 '22 01:10

Kopi Bryant