31

I have checked my app build.gradle file and these are the only lines that are related to firebase in them

/***
 * Firebase
 */
implementation 'com.google.firebase:firebase-core:15.0.0'
implementation 'com.google.firebase:firebase-messaging:15.0.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
    transitive = true
}
implementation 'com.google.firebase:firebase-ads:15.0.0'

I do not have any library that makes use of firebase so I don't think there can be an issue with a library using an older version.

The problem is I can't build gradle, clean project or rebuild project with the new v15 version of firebase as it keeps throwing the error All firebase libraries must be either above or below 14.0.0

Jude Fernandes
  • 7,437
  • 11
  • 53
  • 90
  • can you show us ur build.gradle+ did u add the apply plugin line at the bottom of the file to enable the Gradle plugin? – Dexter Apr 14 '18 at 18:23

10 Answers10

25

Turns out I forgot to change the version number for com.google.android.gms:play-services-ads, switched it to 15.0.0 and it worked.

Here's a blog by Google that provides more information. Announcing new SDK versioning in Google Play services and Firebase

Jude Fernandes
  • 7,437
  • 11
  • 53
  • 90
  • Great, didn't realize there were additional dependencies on other play-services plugins to match the version of the firebase plugin. – tw1742 May 04 '18 at 16:40
19
apply plugin: 'com.google.gms.google-services'

put it under this line.

apply plugin: 'com.android.application'

it worked for me.

Ahmet Şimşek
  • 1,391
  • 1
  • 14
  • 24
2

I have not found the question yet in your question But if you want the latest version of Firebys offices This is compatible with version 27.0.3

//Firebase
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.firebaseui:firebase-ui-database:2.0.1'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
1

Remove this from App level gradle

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

and then try these versions

compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'

this one worked for me... tanx

Humxa Moghal
  • 122
  • 11
0

Change to this work for me:

implementation 'com.firebase:geofire-android:2.1.2'
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.google.firebase:firebase-messaging:12.0.1'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-auth:12.0.1'

Try to find anything above 14.0.0 like:

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

and try to change it to older version like

implementation 'com.google.android.gms:play-services-location:12.0.1'
Kyo Huu
  • 520
  • 7
  • 13
0

For example change implementation 'com.google.android.gms:play-services-appindexing:9.8.0' to implementation 'com.google.firebase:firebase-appindexing:15.0.1' , as this suggestion comes in the warning in build.gradle.

Abhinav Saxena
  • 1,990
  • 2
  • 24
  • 55
0

What worked for me was changing com.google.android.gms:play-services-location:15.+ to com.google.android.gms:play-services-location:11.6.2 so that it's the same version as my com.google.firebase:firebase-messaging:11.6.2 library.

The change was in file platform/android/project.properties.

The location and push notifications library is working perfect now

deanwilliammills
  • 2,617
  • 2
  • 21
  • 27
0

Change all of your firebase libraries to the same version.

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
0

While Changing google or firebase dependency version make sure you update the compatible version in project level gradle too.

Ali Akram
  • 4,803
  • 3
  • 29
  • 38
0

I had same issue and changing the versions solved it:

compile 'com.google.android.gms:play-services-location:16.0.0'
compile 'com.google.firebase:firebase-core:16.0.5'
compile 'com.google.firebase:firebase-appindexing:16.0.2'
compile 'com.google.android.gms:play-services-maps:16.0.1'
compile 'com.google.android.gms:play-services-places:16.0.1'
compile 'com.google.android.gms:play-services-location:16.0.0'
compile 'com.google.firebase:firebase-auth:16.0.5'
compile 'com.google.firebase:firebase-database:16.0.5'
compile 'com.firebaseui:firebase-ui-database:1.0.1'
compile 'com.google.firebase:firebase-storage:16.0.5'
compile 'com.google.firebase:firebase-messaging:17.3.4'

Hope this helps

AllSmiles
  • 53
  • 2
  • 7