Android生成签名APK获得重复的问题

时间:2017-02-17 01:28:15

标签: java android facebook android-gradle apk

当我尝试生成签名APK时,我收到以下错误

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

调试APK工作正常。在我加入Facebook SDK之后,我才面临这个问题......任何人都可以帮我解决这个问题

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

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

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


android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
    applicationId "mani.com.howhighru"
    minSdkVersion 15
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
dexOptions {
    javaMaxHeapSize "4g"
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services:10.2.0'
compile 'com.googlecode.json-simple:json-simple:1.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
testCompile 'junit:junit:4.12'
compile('com.twitter.sdk.android:twitter:2.3.1@aar') {
    transitive = true;
}
}

0 个答案:

没有答案