我的gradle版本是4.2.1-all,而我的gradle插件版本是3.0.1。

我的应用程序模块build.gradle如下所示:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
    applicationId "com.example.demo"
    minSdkVersion 14
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

    //Retrofit
    implementation "com.squareup.retrofit2:retrofit:2.3.0"
    implementation "com.squareup.retrofit2:adapter-rxjava2:2.3.0"
    implementation "com.squareup.retrofit2:converter-jaxb:2.3.0"
    implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
}

当我单击“与Gradle文件同步项目”时,出现类似标题的错误。有人可以帮我吗?

最佳答案

maven respository中搜索转换器jaxb,找不到它。
看到github issue 2690,您会知道原因!

关于android - 无法解决:com.squareup.retrofit2:converter-jaxb:2.3.0,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/49254453/

10-16 23:32