Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Android Gradle plugin supports only Crashlytics Gradle plugin version 1.25.4 and higher. Project '***' is using version 1.25.1

Tags:

android

Evironment: Android Studio 3.2

I got a error

The Android Gradle plugin supports only Crashlytics Gradle plugin version 1.25.4 and higher. Project '***' is using version 1.25.1.

Any idea how to solve? Thank you.

like image 558
Jack Wilson Avatar asked Sep 25 '18 20:09

Jack Wilson


2 Answers

The "Crashlytics Gradle plugin" is found in gradle in the io.fabric.tools:gradle package as mentioned on https://firebase.google.com/docs/crashlytics/get-started#android

You should find that in your projects root build.gradle file. Similar to this

buildscript {     repositories {         jcenter()         google()         maven { url 'https://maven.fabric.io/public' }     }     dependencies {         classpath 'io.fabric.tools:gradle:1.25.1'         ...     } }  allprojects {     ... 

Once you change it to classpath 'io.fabric.tools:gradle:1.25.4' that error should go away.

The versions of a maven dependency can also be found in its maven repository under

https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml

That trick should work for all maven repositories once you know the url:

<repo-base-url>/${groupId.replace('.','/')}/${artifactId}/maven-metadata.xml

You can also use a gradle plugin such as https://github.com/ben-manes/gradle-versions-plugin to have it lookup the latest versions in those maven-metadata.xml files for you.

If you simply want the latest you can also define the version with a wildcard, e.g.

classpath 'io.fabric.tools:gradle:1.+' // or even ...:gradle:+' 

That would always give you the latest version that starts with 1.. It's rarely done in production since builds become less deterministic when dependency versions change from one moment to the next. But it's good to check whether gradle downloads a newer version.

Furthermore, Android Studio does check versions too, however you don't see the difference between there being no new version and when the check wasn't done yet. But when it did, you'll get an inspection hint and it can be quick fixed.

like image 90
zapl Avatar answered Oct 15 '22 19:10

zapl


This exact error message can be encountered another way: outdated version of react-native-firebase. Zapl's solution is more likely necessary, but you may simply need to update your package.json.

In my case, a git merge had brought in all the latest latest firebase SDK for Android in my /android directory, but my package.json was left referring to an older version of react-native-firebase (3.x). I set it to 5.3 and problem solved.

like image 33
lance.dolan Avatar answered Oct 15 '22 19:10

lance.dolan