发布版本错误:重复条目:javax / xml / XMLConstants.class

时间:2018-01-16 13:04:00

标签: java android

我正在尝试生成发布版本。首先我得到了

  

DuplicatePlatformClasses错误

我尝试使用论坛上的解决方案修改build.gradle文件来解决这些问题。但是我坚持这个错误。我是Android开发的新手。

我收到以下错误:

  

错误:任务执行失败   ':应用程序:transformClassesWithJarMergingForRelease&#39 ;.   com.android.build.api.transform.TransformException:   java.util.zip.ZipException:重复条目:   的javax / XML / XMLConstants.class

这是我的build.gradle文件

    buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

configurations {
    all {
        exclude module: 'httpclient'
        exclude module: 'xpp3'
    }
}

android {

    configurations {
        all*.exclude group: 'com.android.support', module: 'support-v4'
    }

    signingConfigs {
        debug {
            storeFile file('../keystore/debug_keystore.jks')
            storePassword 'firstup'
            keyAlias 'FirstUp'
            keyPassword 'firstup'
        }
        release {
            storeFile file('../keystore/firstup.jks')
            storePassword 'first:up-pass'
            keyAlias 'firstup_alias'
            keyPassword 'first:up-pass'
        }
    }

    compileSdkVersion 27
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "com.firstup.android"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 12
        versionName "1.0.5"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
        debug {
            signingConfig signingConfigs.debug
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}


dependencies {
    implementation ('net.sourceforge.htmlunit:htmlunit:2.23') {
        exclude module: 'commons-logging'
        exclude module: 'httpclient'
    }

    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:cardview-v7:27.0.2'
    implementation 'com.android.support:appcompat-v7:27.0.0'
    implementation 'com.android.support:support-v4:27.0.0'
    implementation 'com.android.support:recyclerview-v7:27.0.0'
    implementation 'com.android.support:design:27.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.android.gms:play-services-auth:11.4.2'
    implementation 'com.google.android.gms:play-services-base:11.4.2'
    //    implementation 'com.google.android.gms:play-services-gcm:11.4.2'
    //     ExoPlayer
    implementation 'com.google.android.exoplayer:exoplayer:r2.4.4'
    // Mixpanel
    implementation 'com.mixpanel.android:mixpanel-android:4.9.8'
    // SwipeLayout
    implementation 'com.github.rambler-digital-solutions:swipe-layout-android:1.0.14'
    // ViewPagerIndicator
    implementation 'me.relex:circleindicator:1.2.2@aar'
    // ButterKnife
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    // Dagger 2
    implementation 'com.google.dagger:dagger:2.12'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.12'
    //MaterialPicker
    implementation 'com.wdullaer:materialdatetimepicker:3.1.2'
    // RxAndroid
    implementation 'io.reactivex:rxjava:1.2.0'
    implementation 'io.reactivex:rxandroid:1.2.1'
    // Retrofit
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
    implementation 'com.squareup.retrofit2:converter-simplexml:2.3.0'
    // Gson
    implementation 'com.google.code.gson:gson:2.8.0'
    // Facebook
    implementation 'com.facebook.android:facebook-android-sdk:4.19.0'
    // Glide
    implementation 'com.github.bumptech.glide:glide:4.3.0'
    //noinspection GradleCompatible
    implementation 'com.android.support:customtabs:27.0.0'
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    testCompile 'junit:junit:4.12'
    compile('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
        transitive = true;
    }
    compile 'com.android.support:support-annotations:27.0.2'
    compile 'com.android.support:support-v13:27.0.2'
    compile 'com.android.support:support-vector-drawable:27.0.2'
    compile 'com.android.support:gridlayout-v7:27.0.2'
    compile 'com.android.support:mediarouter-v7:27.0.2'
}

0 个答案:

没有答案