这是我使用的依赖项:
dependencies {
implementation ("androidx.core:core-ktx:1.10.1")
implementation ("androidx.appcompat:appcompat:1.6.1")
implementation ("com.google.android.material:material:1.9.0")
implementation ("androidx.constraintlayout:constraintlayout:2.1.4")
implementation ("androidx.gridlayout:gridlayout:1.0.0")
testImplementation ("junit:junit:4.13.2")
androidTestImplementation ("androidx.test.ext:junit:1.1.5")
androidTestImplementation ("androidx.test.espresso:espresso-core:3.5.1")
implementation ("com.airbnb.android:lottie:6.1.0")
implementation ("com.square.retrofit2:converter-gson:2.9.0")
implementation ("com.square.retrofit2: retrofit:2.9.0")
implementation ("com.google.code.gson:gson:2.10.1")`
}
显示以下错误:
Failed to resolve: com.square.retrofit2:converter-gson:2.9.0
Failed to resolve: com.square.retrofit2: retrofit:2.9.0
使用不同版本(而不是2.9.0)也显示相同的错误。谁能帮我解决这个问题吗?
正确的依赖项是:
implementation ("com.squareup.retrofit2:converter-gson:2.9.0")
implementation ("com.squareup.retrofit2:retrofit:2.9.0")
您可以在这里验证它们: