Gradle 3.0 transformClassesWithStackFramesFixerForDebug重复条目

时间:2017-11-05 16:05:16

标签: android android-studio gradle

我已经在谷歌上搜索并搜索了解决方案但尚未找到它。我刚刚将我的Android Studio更新为3.0,并且我试图移植我的应用程序以使用功能模块以便能够制作即时应用程序,但是当我尝试从Android Studio运行该应用程序时,我得到以下内容错误:

Error:Execution failed for task 
':app:transformClassesWithStackFramesFixerForDebug'.
> com.android.build.api.transform.TransformException: 
java.lang.RuntimeException: java.lang.RuntimeException: 
java.util.concurrent.ExecutionException: 
java.util.concurrent.ExecutionException: 
com.android.builder.utils.FileCache$FileCreatorException: 
java.util.zip.ZipException: duplicate entry: META-INF/MANIFEST.MF

我尝试使用packagingOptions排除此类文件,但显然无效。这是我的build.gradle文件:

项目build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
ext {
    compileSdkVersion = 26

    supportLib = '26.1.0'
}

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}
allprojects {
    repositories {
        jcenter()
        google()
    }
}

App module 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' }
    maven { url "https://jitpack.io" }
    maven { url "https://s3.amazonaws.com/avocarrot-android-builds/dist" }
    maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
    maven { url "https://maven.google.com" }

    flatDir {
        dirs 'libs'
    }
}

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'

    defaultConfig {

        applicationId "com.myapp.mobile"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 23004003
        versionName "4.0.0.3"
        multiDexEnabled true
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        abortOnError false
    }

    dexOptions {
        javaMaxHeapSize "4g"
    } 


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    packagingOptions {
        exclude 'META-INF/rxjava.properties'
        exclude 'META-INF/MANIFEST.MF'
    }
}

dependencies {
    def mopub = '4.16.0@aar'
    def avocarrot = '4.6.0'
    def exoplayer = 'r2.2.0'
    def mobfox = '3.2.3'
    def pubnative = '2.0.4'
    def facebook = '4.+'
    def pubnativeFacebookAdapter = '2.0.2-4.22.1'
    def taboola = '1.3.1'
    def okhttp = '3.8.1'
    def okio = '1.13.0'
    def picasso = '2.5.2'
    def firebase = '11.4.0'
    def playServices = '11.4.0'
    def supportLib = '26.1.0'
    def gson = '2.8.1'
    def circleimageview = '2.1.0'
    def floatingactionbutton = '1.3.0'
    def mpAndroidChart = 'v3.0.2'
    def gridViewHeaderFooter = '1.0.12'
    def multidex = '1.0.1'
    def floatingsearchview = '2.0.3'
    def cropper = '1.0.1@aar'
    def adapterdelegates = '3.0.1'
    def rxjava = '2.x.y'
    def rxandroid = '2.0.1'
    def rxjavaAdapter = '2.3.0'
    def retrofit = '2.3.0'
    def rxbinding = '2.0.0'
    def diagonallayout = '1.0.6'
    def fabSpeedDial = '1.0.6'
    def butterknife = '8.7.0'
    def sqlbrite = '2.0.0'
    def leakcanary = '1.5.1'
    def debugDB = '1.0.1'
    def crashlytics = '2.6.8@aar'

    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation files('libs/admarvel-android-sdk-core-adcolony.jar')
    implementation files('libs/libAdapterSDKMoPub.jar')
    implementation files('libs/AdMobMediationAdapter.jar')
    implementation files('libs/lsmsdkadmobmediationadapter.jar')
    implementation files('libs/MobFox-Android-AdMob-Adapter.jar')
    implementation files('libs/gcm.jar')
    implementation files('libs/achartengine-1.1.0.jar')
    implementation files('libs/comscore.jar')
    implementation files('libs/hmediaLib-1.3.0.jar')
    implementation(name:'adux-1.0.0', ext:'aar')
    implementation "com.avocarrot.sdk:mediation-sdk-nativead:$avocarrot"
    implementation "com.google.android.exoplayer:exoplayer:$exoplayer"
    implementation "com.facebook.android:audience-network-sdk:$facebook"
    implementation "com.facebook.android:facebook-android-sdk:$facebook"
    implementation "com.google.ads.mediation:facebook:$facebook"
    implementation "com.github.mobfox:MobFox-Android-SDK-Core:$mobfox"
    implementation "net.pubnative:sdk:$pubnative"
    implementation "net.pubnative:sdk.adapter.facebook:$pubnativeFacebookAdapter"
    implementation "com.squareup.okhttp3:okhttp:$okhttp"
    implementation "com.squareup.okio:okio:$okio"
    implementation "com.squareup.picasso:picasso:$picasso"
    implementation "com.android.support:cardview-v7:$rootProject.supportLib"
    implementation "com.android.support:support-v4:$rootProject.supportLib"
    implementation "com.android.support:recyclerview-v7:$rootProject.supportLib"
    implementation "com.android.support:design:$rootProject.supportLib"
    implementation "com.android.support:customtabs:$rootProject.supportLib"
    implementation "com.google.android.gms:play-services-analytics:$playServices"
    implementation "com.google.android.gms:play-services-ads:$playServices"
    implementation "com.google.android.gms:play-services-wearable:$playServices"
    implementation "com.google.code.gson:gson:$gson"
    implementation "de.hdodenhof:circleimageview:$circleimageview"
    implementation "com.melnykov:floatingactionbutton:$floatingactionbutton"
    implementation "com.github.PhilJay:MPAndroidChart:$mpAndroidChart"
    implementation "in.srain.cube:grid-view-with-header-footer:$gridViewHeaderFooter"
    implementation "com.android.support:multidex:$multidex"
    implementation "com.github.arimorty:floatingsearchview:$floatingsearchview"
    implementation "com.soundcloud.android:android-crop:$cropper"
    implementation "com.hannesdorfmann:adapterdelegates3:$adapterdelegates"
    implementation "io.reactivex.rxjava2:rxjava:$rxjava"
    implementation "io.reactivex.rxjava2:rxandroid:$rxandroid"
    implementation "com.squareup.retrofit2:adapter-rxjava2:$rxjavaAdapter"
    implementation "com.squareup.retrofit2:retrofit:$retrofit"
    implementation "com.squareup.retrofit2:converter-gson:$retrofit"
    implementation "com.squareup.okhttp3:logging-interceptor:$okhttp"
    implementation "com.jakewharton.rxbinding2:rxbinding:$rxbinding"
    implementation "com.jakewharton.rxbinding2:rxbinding-support-v4:$rxbinding"
    implementation "com.github.florent37:diagonallayout:$diagonallayout"
    implementation "io.github.yavski:fab-speed-dial:$fabSpeedDial"
    implementation "com.google.firebase:firebase-messaging:$firebase"
    implementation "com.jakewharton:butterknife:$butterknife"
    implementation "com.squareup.sqlbrite2:sqlbrite:$sqlbrite"
    annotationProcessor "com.jakewharton:butterknife-compiler:$butterknife"
    debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanary"
    releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary"
    testImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary"
    debugImplementation "com.amitshekhar.android:debug-db:$debugDB"

implementation("com.crashlytics.sdk.android:crashlytics:$crashlytics") 
    {
        transitive = true
    }
    implementation(name: 'DebugSettings', ext: 'aar')

    wearApp project(':wear')
    implementation project(':myapp-base')
}


apply plugin: 'com.google.gms.google-services'

基础模块build.gradle

apply plugin: 'com.android.feature'

repositories {
    maven { url "https://maven.google.com" }
}

android {
    compileSdkVersion rootProject.compileSdkVersion
    buildToolsVersion '26.0.2'

    baseFeature true

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    api "com.android.support:appcompat-v7:$rootProject.supportLib"
    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'
    application project(':app')
}

1 个答案:

答案 0 :(得分:0)

您在应用的build.gradle中将libs目录包括两次

viewDidLoad

这可能是您的问题所在。决定将这些包括在内的一种方式,并让我知道这是否有效。