Reputation: 6245
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.
Upvotes: 34
Views: 19099
Reputation: 7385
For those of you running into this issue while trying to use the firebase_crashlytics plugin for Flutter, be sure you only follow the instructions for the plugin itself on the pub.dev page there. Do not follow the instructions on the Firebase site. Doing both will create conflicts.
You may still have to update the version number for the io.fabric.tools:gradle
classpath in your android/build.gradle
file to the version the error log is asking for.
Edit: For those looking for the latest fabric version, you can find it here: https://s3.amazonaws.com/fabric-artifacts/public/io/fabric/tools/gradle/maven-metadata.xml
Upvotes: 1
Reputation: 4032
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.
Upvotes: 1
Reputation: 63945
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.
Upvotes: 58