【问题标题】:Gradle sync failed: Could not find com.google.code.gson:gson:2.8.5. Searched in the following locations:Gradle 同步失败:找不到 com.google.code.gson:gson:2.8.5。在以下位置搜索:
【发布时间】:2021-06-23 16:48:26
【问题描述】:

我的一位同事在尝试同步 gradle 时收到以下错误:

Gradle sync failed: Could not find com.google.code.gson:gson:2.8.5.
                    Searched in the following locations:
                    - https://dl.google.com/dl/android/maven2/com/google/code/gson/gson/2.8.5/gson-2.8.5.pom
                    If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
                    Required by:
                    project :app > com.google.gms:google-services:4.3.3
                    project :app > com.google.firebase:firebase-crashlytics-gradle:2.3.0 > com.google.firebase:firebase-crashlytics-buildtools:2.3.0 (48 s 278 ms)

我们使用相同版本的 Android Studio 4.2.1 运行相同的项目。我的机器上没有任何错误,但她似乎有问题。她的操作系统是 windows 10,我使用的是 mac。

我应该提到我已经看过这个帖子:https://github.com/google/gson/issues/1637 并按照此处的说明进行操作 https://github.com/firebase/quickstart-android/blob/master/messaging/build.gradle。但是,它似乎并不能解决问题。实际上,如果确实如此,我会担心,因为不更改 gradle 文件对我有用。

有谁知道这可能是什么问题?谢谢。

另外我应该提一下,当我试图点击错误消息中的链接时,它是一个死链接。

【问题讨论】:

  • 我的 Android studio 4.2.2 版本也有同样的问题
  • 我们最终卸载了 android studio 并安装了测试版。仍然遇到一些问题,但最终都解决了。您可能需要更深入地研究如何从 android studio 中卸载“一切”。因为它看起来从 Windows 的控制面板卸载实际上并没有卸载所有内容。

标签: android android-studio android-gradle-plugin


【解决方案1】:

我更新到 4.2.2 后也有这个问题。 - AS 4.2.2 显示代码错误:无法解析符号“Gson”,但代码可以正确编译并运行。

【讨论】:

    猜你喜欢
    • 2019-01-08
    • 2019-03-30
    • 1970-01-01
    • 1970-01-01
    • 2016-10-05
    • 2018-10-25
    • 1970-01-01
    • 1970-01-01
    • 2019-04-02
    相关资源
    最近更新 更多