【问题标题】:Android Studio BUILD FAILED duplicate entry: com/google/thirdparty/publicsuffix/PublicSuffixPatterns.classAndroid Studio BUILD FAILED 重复条目:com/google/thirdparty/publicsuffix/PublicSuffixPatterns.class
【发布时间】:2017-06-02 05:21:29
【问题描述】:

我在尝试生成应用程序 APK 时遇到以下错误。

错误:任务 ':app:transformClassesWithJarMergingForRelease' 执行失败。 com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com/google/thirdparty/publicsuffix/PublicSuffixPatterns.class

它是在我添加后出现的:“ multiDexEnabled true ” 到我的 gradle 文件。但这是必要的。

谁能帮帮我?

gradle 文件包含以下内容:

apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"


    lintOptions{
        checkReleaseBuilds false
    }

    defaultConfig {
        applicationId "pl.nowakprojects.socialmafia"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "0.1"
        multiDexEnabled true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    buildTypes.each {
        it.buildConfigField 'boolean', 'PREMIUM_VERSION', PremiumVersionBoolean
     }
}

ext {
    JUNIT_VERSION = '4.12'
    DAGGER_VERSION = '2.4'
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'org.parceler:parceler:1.1.5'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.android.support:design:25.1.0'
    compile 'com.android.support:cardview-v7:25.1.0'
    compile 'com.android.support:recyclerview-v7:25.1.0'
    compile 'com.android.support:support-v4:25.1.0'
    compile 'org.parceler:parceler-api:1.1.5' //Parceler - przenoszenie obiektow miedzy Activity
    compile 'com.jakewharton:butterknife:8.4.0' //ButterKnife
    compile 'com.jakewharton:butterknife-compiler:8.4.0'
    compile 'com.afollestad.material-dialogs:core:0.9.0.2'
    compile 'org.greenrobot:eventbus:3.0.0' //EventBus
    compile 'me.tankery.lib:circularSeekBar:1.1.3' //SeekBar
   // compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
    //compile 'com.android.support.constraint:constraint-layout:1.0.0-beta3'
    compile 'com.annimon:stream:1.1.4'
    //compile "com.google.auto.value:auto-value:1.2"
}

【问题讨论】:

标签: java android gradle duplicates


【解决方案1】:

这个问题是因为compile 'org.parceler:parceler:1.1.5' gradle。

只需删除compile 'org.parceler:parceler:1.1.5',它 会工作的。

不知道这个问题的根本原因。

【讨论】:

  • @Mat 他说得对,您的应用程序中应该有 parceler,该模块应该是 apt/annotationProcessor 条目。与butterkninfe-compiler 相同。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-28
  • 1970-01-01
相关资源
最近更新 更多