我无法在Kotlin中实施改造

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

我正在关注本教程:https://www.youtube.com/watch?v=w6MvFXz5ecA我正在尝试在新的空项目中将app.gradle中的以下行与改造同步:

implementation 'com.squareup.retrofit2:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'

但是当我同步时,出现此错误:错误:无法解决:com.squareup.retrofit2:2.3.0:受影响的模块:应用]

build.gradle(Module:app)的完整内容是:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.1"
    defaultConfig {
        applicationId "com.smartherd.retrofityt"
        minSdkVersion 19
        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'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    implementation 'com.squareup.retrofit2:2.5.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
}

[额外数据:

我正在使用Android Studio 3.5.3

Android SDK Toools 26.1.1

改造2.5.0

kotlin synchronization retrofit implementation
1个回答
0
投票

您错过了工件ID,retrofit

implementation 'com.squareup.retrofit2:retrofit:2.5.0'
© www.soinside.com 2019 - 2024. All rights reserved.