【问题标题】:Android Studio says (in gradle file) that there is newer version of libraryAndroid Studio 说(在 gradle 文件中)有更新版本的库
【发布时间】:2021-03-13 07:59:33
【问题描述】:

Android 工作室说:

“com.squareup.picasso:picasso 有比 2.8 更新的版本:2.71828”

Screenshot from Android Studio

但我看到 2.8 是 https://github.com/square/picasso/releases 上的最新版本。

我的项目的 Gradle 构建脚本:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.1'
        classpath 'com.google.gms:google-services:4.3.4'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我猜 Gradle 看起来不是在 GitHub 上,而是在其他一些存储库上?如果是,我应该改变吗

implementation 'com.squareup.picasso:picasso:2.8'

类似

implementation 'com.github.square:picasso:2.8'

或者我应该改为:

implementation 'com.squareup.picasso:picasso:2.71828'

【问题讨论】:

  • 如果你这样做File > Invalidate Caches / Restart会解决它吗?
  • @MSpeed - 不,在我写到这里之前测试过

标签: android android-studio gradle build.gradle picasso


【解决方案1】:

这是他们GitHub 上的一个已知问题

如前所述:

将毕加索版本 2.71828 更新至 2.8。现在 Android Lint 抱怨 有一个更新的版本 2.71828 可用。这是真的 自 71828 > 8 以来的语义版本控制意义。

可以禁止对库进行 GradleDependency lint 检查以 摆脱警告。但是,我会发现如果版本更好 number 分量反而是单调递增的。

所以保持原样。

如果它真的困扰你,你可以这样做来抑制警告:

//noinspection GradleDependency
implementation 'com.squareup.picasso:picasso:2.8'

【讨论】:

  • 谢谢!我想了解我是否做错了什么,或者知道您提供的解释。
  • 没问题的朋友很高兴为您提供帮助!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-06-13
  • 1970-01-01
  • 2020-06-12
  • 2018-11-06
  • 1970-01-01
  • 2014-07-29
  • 1970-01-01
相关资源
最近更新 更多