android - org.apache.http.ContentTooLongException消息{种类=错误,文本=程序类型已存在:org.apache.http.ContentTooLongException

标签 android gradle android-gradle-plugin

Program type already present: org.apache.http.ContentTooLongException 
Message{kind=ERROR, text=Program type already present: org.apache.http.ContentTooLongException, sources=[Unknown source file], tool name=Optional.of(D8) }
build.gradle
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.sample.io.sos"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    buildToolsVersion '28.0.0'
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    dependencies {
        compileOnly 'javax.annotation:jsr250-api:1.0'
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
    implementation 'com.android.support:design:28.0.0-alpha3'
    implementation 'com.judemanutd:autostarter:1.0.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation "com.squareup.retrofit2:retrofit:2.4.0"
    implementation "com.squareup.retrofit2:converter-gson:2.4.0"
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.7'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
    implementation 'com.squareup.retrofit:retrofit:1.6.1'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'org.parceler:parceler-api:1.1.10'
    annotationProcessor 'org.parceler:parceler:1.1.10'
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

    implementation 'io.swagger:swagger-annotations:1.5.15'
    implementation 'io.gsonfire:gson-fire:1.8.0'
    implementation 'org.threeten:threetenbp:1.3.5'
    implementation "com.google.code.gson:gson:2.8.2"
    implementation "org.apache.httpcomponents:httpcore:4.4.4"
    implementation "org.apache.httpcomponents:httpmime:4.5.2"
    implementation "org.apache.httpcomponents:httpclient-android:4.3.3"
    implementation "com.android.volley:volley:1.1.0"
    testImplementation "org.robolectric:robolectric:3.0"
    testImplementation "net.jodah:concurrentunit:0.4.2"
    testImplementation "junit:junit:4.12"
}

无法解决这个问题。在这里,我在项目中使用了swagger生成的android java代码。该相关的实现已添加。

最佳答案

Swagger为旧版本提供sdk(compileSdkVersion 25)。仍然他们没有更新该SDK。但是我想开发最新版本的28。该sdk上还有更多版本不兼容的问题。
我在github中报告了这个问题。
Swagger issues

关于android - org.apache.http.ContentTooLongException消息{种类=错误,文本=程序类型已存在:org.apache.http.ContentTooLongException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51054639/

相关文章:

android - 如何与 Activity 中持续运行的后台服务通信?

android - 在自动完成中输入纬度/经度

android - 共享对话框不起作用

android - 表达 gradle 依赖关系的语义

android - 每次gradle同步后找不到Android SDK

android - Android Studio 项目开启时间过长

android - 我如何响应 Android MapView 上的点击,但忽略双指缩放?

android - 如何让 Android Studio 将文件识别为源(测试)

android - 更新Android Studio后,Android资源编译失败

unit-testing - 为什么 Android Studio 会说 "Test events were not received"?