android - 错误:无法解析“:app@releaseUnitTest/compileClasspath”的依赖关系:无法解析com.squareup.retrofit2:retrofit:2.3.0
问题描述
此代码显示改造依赖错误,我目前使用的是Android Studio 3.5.2。请帮我解决这个依赖
错误:无法解析“:app@releaseUnitTest/compileClasspath”的依赖关系:无法解析com.squareup.retrofit2:retrofit:2.3.0
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.blog"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:convertor-gson:2.3.0'
解决方案
尝试使用最新版本的改造,如下所示。
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
推荐阅读
- julia - 在 Julia 中使用带有 GPU 的通量时出错
- docker - 无法使用新映像更新 Minikube 部署
- reactjs - Firebase 数据库抛出“Firebase 错误。请确保您的 Firebase 名称拼写正确”
- grep - Linux中的正则表达式
- ios - 在 CollectionViewcell 中实现 UIScrollView
- caching - Blazor 服务器应用程序中的应用程序范围数据
- node.js - 我有与我的 npm 构建相关的错误,并且开始找不到我的构建脚本和我的节点版本与全局版本不匹配
- java - 片段未打开 (Android/Java)
- python - 如何在 matplotllib 条形图的 x 轴上添加第二行标签
- docker - Docker 使用 GitBash / Cmder - 路径问题