无法解析:'com.squareup.retrofit2.converter-gson:2.3.0'

问题描述 投票:0回答:6

我正在尝试使用 Android Studio 3.2 Canary 5 包含

'com.squareup.retrofit2.converter-gson:2.3.0'

见下图

retrofit
6个回答
3
投票

你可以在谷歌搜索,把这个工作,我希望它也能帮助你

implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.4'

Solution


1
投票
implementation 'com.squareup.retrofit2:converter-gson:<latest-version>'

可以在这里找到最新版本。


0
投票

只需粘贴此即可:

  • 实现“com.google.code.gson:gson:2.8.5”

  • 实现'com.squareup.retrofit2:retrofit:2.6.1'


0
投票

使用(如果可能)最新版本,我遇到了同样的错误,但看起来改造'com.squareup.retrofit2.converter-gson:2.3.0'版本2.3.0已弃用。

这对我有用:

//Retrofit2
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'

来源:

https://square.github.io/retrofit/

https://github.com/square/retrofit


0
投票

效果非常好。

//retrofit
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
implementation 'com.squareup.retrofit2:converter-gson:2.8.1'

它提供/提供您需要的最新存储库。


0
投票

在我使用之前似乎没有什么对我有用:

retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version = "2.9.0" } gson = { group = "com.google.code.gson", name = "gson", version = "2.10.1" } 转换器= {组=“com.squareup.retrofit2”,名称=“converter-gson”,版本=“2.9.0”} 在我的 .toml 文件中。

© www.soinside.com 2019 - 2024. All rights reserved.