【问题标题】:Program type already present: com.android.internal.http.multipart.ByteArrayPartSource程序类型已经存在:com.android.internal.http.multipart.ByteArrayPartSource
【发布时间】:2019-12-20 06:48:40
【问题描述】:

我正在尝试创建我的项目的构建,但它给了我错误'''程序类型已经存在:com.android.internal.http.multipart.ByteArrayPartSource'''。我了解我的依赖项中的某些文件是重复的。我试图在各个地方排除这个组,但完全找不到正确的方法。

以下是我正在使用的依赖项

 implementation project(':segmentControlLibrary')
    implementation project(':googleplayservices_lib')
    implementation project(':webservice')
    implementation project(':PDFViewCtrlTools')
    implementation files('libs/acra-4.5.0.jar')
    implementation files('libs/httpmime-4.2.1.jar')
    //compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
    implementation project(':library')
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'it.sephiroth.android.library.horizontallistview:hlistview:1.3.1'
    implementation 'net.zetetic:android-database-sqlcipher:4.2.0@aar'
    implementation 'com.github.bumptech.glide:glide:4.10.0'
    implementation 'com.github.angads25:filepicker:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'fr.avianey.com.viewpagerindicator:library:2.4.1.1@aar'
    implementation 'com.pdftron:pdftron:7.0.3'
    implementation ('com.pdftron:tools:7.0.3'){
        exclude  group: 'com.google.code.gson', module: 'gson'
    }

    implementation files('libs/org.apache.http.legacy.jar')
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.google.android.material:material:1.1.0-alpha06'

谁能帮助哪个模块可能包含我需要排除的容易出错的组。

注意:我可以直接在设备中运行应用程序,但无法创建调试或发布 apk。

【问题讨论】:

    标签: android gradle android-build android-install-apk


    【解决方案1】:

    删除

    implementation 'com.google.android.material:material:1.1.0-alpha06'

    您已经将上面的材料库声明为

    implementation 'com.google.android.material:material:1.0.0'

    【讨论】:

    • 已删除但仍然是同样的问题
    【解决方案2】:

    试试这个

    android{
    packagingOptions {
            exclude 'META-INF/DEPENDENCIES'
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/license.txt'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/notice.txt'
            exclude 'META-INF/ASL2.0'
            exclude("META-INF/*.kotlin_module")
            exclude 'org/apache/http/version.properties'
            exclude 'org/apache/http/client/version.properties'
            exclude 'org/apache/http/entity/mime/version.properties'
        }
     }
    
    dependencies {
        implementation project(':segmentControlLibrary')
        implementation project(':googleplayservices_lib')
        api project(':webservice')
        implementation files('libs/acra-4.5.0.jar')
        implementation project(':library')
        implementation 'androidx.appcompat:appcompat:1.1.0'
        implementation 'com.google.android.material:material:1.0.0'
        implementation 'androidx.legacy:legacy-support-v4:1.0.0'
        implementation 'androidx.cardview:cardview:1.0.0'
        implementation 'androidx.recyclerview:recyclerview:1.1.0'
        implementation 'it.sephiroth.android.library.horizontallistview:hlistview:1.3.1'
        implementation 'net.zetetic:android-database-sqlcipher:4.2.0@aar'
        implementation 'com.github.bumptech.glide:glide:4.10.0'
        implementation 'com.github.angads25:filepicker:1.1.0'
        implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
        implementation 'com.squareup.picasso:picasso:2.71828'
        implementation 'fr.avianey.com.viewpagerindicator:library:2.4.1.1@aar'
        implementation 'com.pdftron:pdftron:7.0.3'
        implementation('com.pdftron:tools:7.0.3') {
            exclude group: 'com.google.code.gson', module: 'gson'
        }
        implementation 'com.android.support:multidex:1.0.3'
        compileOnly files('libs/httpmime-4.5.10.jar')
        compileOnly files('libs/httpcore-4.4.12.jar')
        compileOnly files('libs/httpclient-4.5.10.jar')
        implementation 'com.google.code.gson:gson:2.8.6'
    }

    【讨论】:

    • 现在它给出了已经存在的程序类型:com.pdftron.pdf.tools.BuildConfig...
    猜你喜欢
    • 2018-09-23
    • 2019-02-22
    • 1970-01-01
    • 2018-10-21
    • 1970-01-01
    • 2018-10-03
    • 2019-04-10
    • 2018-11-15
    • 1970-01-01
    相关资源
    最近更新 更多