Android Gradle插件仅支持Crashlytics Gradle插件1.25.4及更高版本.项目"***"正在使用版本1.25.1 [英] The Android Gradle plugin supports only Crashlytics Gradle plugin version 1.25.4 and higher. Project '***' is using version 1.25.1

查看:87
本文介绍了Android Gradle插件仅支持Crashlytics Gradle插件1.25.4及更高版本.项目"***"正在使用版本1.25.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境:Android Studio 3.2

Evironment: Android Studio 3.2

我遇到了错误

Android Gradle插件仅支持Crashlytics Gradle插件版本1.25.4及更高版本.项目"***"正在使用1.25.1版.

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.

推荐答案

io.fabric.tools:gradle 包的gradle中找到"Crashlytics Gradle插件".="https://firebase.google.com/docs/crashlytics/get-started#android" rel ="noreferrer"> https://firebase.google.com/docs/crashlytics/get-started#android

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

您应该在项目根 build.gradle 文件中找到该文件.与此类似

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 {
    ...

一旦将其更改为 classpath'io.fabric.tools:gradle:1.25.4',该错误就会消失.

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

还可以在其maven存储库中的

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

一旦您知道url,该技巧就应该适用于所有Maven存储库:

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

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

您还可以使用gradle插件,例如 https://github.com/ben-manes/gradle-versions-plugin 使其在那些 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:+'

这将始终为您提供以 1.开头的最新版本.在生产环境中很少这样做,因为当依赖版本从一瞬间切换到下一瞬间时,构建的确定性就会降低.但是最好检查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.

此外,Android Studio也会检查版本,但是您看不到没有新版本和尚未完成检查之间的区别.但是,这样做后,您会得到一个检查提示,并且可以快速修复.

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.

这篇关于Android Gradle插件仅支持Crashlytics Gradle插件1.25.4及更高版本.项目"***"正在使用版本1.25.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆