java.util.zip.ZipException: duplicate entry: AbstractHttpContent.class

与世无争的帅哥 提交于 2019-12-24 01:12:45

问题


I'm getting the duplicate entry error for abstractHttpContent.class which is part of app engine.

I'm using google app engine backend. I also have multidex enabled, without multidex it give me an method exceeded error.

here is my app gradle file

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

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"


    defaultConfig {
        applicationId "com.example.joseph.googlesign_in"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }

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


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.google.android.gms:play-services-auth:8.3.0'
    compile project(path: ':gsiBackend', configuration: 'android-endpoints')
    compile project(':gsiBackend')
}

Here is my backend gradle file

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.google.appengine:gradle-appengine-plugin:1.9.18'
    }
}

repositories {
    jcenter();
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

dependencies {
    appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.18'
    compile 'com.google.appengine:appengine-endpoints:1.9.18'
    compile 'com.google.appengine:appengine-endpoints-deps:1.9.18'
    compile 'javax.servlet:servlet-api:2.5'
}

appengine {
    downloadSdk = true
    appcfg {
        oauth2 = true
    }
    endpoints {
        getClientLibsOnBuild = true
        getDiscoveryDocsOnBuild = true
    }
}

The location of abstractHttpContent.class

It seems the error started after adding google play services to use google sign in.
Has anyone encountered this build error? Any advice on how to fix it?
Thanks


回答1:


As we discuss, I believe Google play services 8.3 made some changes on the google signin system. You can check out here: https://developers.google.com/android/guides/releases#november_2015_-_v83

So I suggest that you can try to use version 8.1.

The issue was with google play services.
Here is top level gradle file

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

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Change the following From

classpath 'com.google.gms:google-services:1.5.0-beta2'

To

classpath 'com.google.gms:google-services:1.5.0'  

Also the aapt.exe was timing out and displaying an error.
Ran the appt.exe file to make sure it was running and everything seems to be working now.

Tried to run the app with mulidex disabled and it still works




回答2:


The issue was with google play services.
Here is my top level gradle file

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

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Change the following From

classpath 'com.google.gms:google-services:1.5.0-beta2'

To

classpath 'com.google.gms:google-services:1.5.0'  

Also the aapt.exe was timing out and displaying an error.
I ran the appt.exe file to make sure it was running and everything seems to be working now.

I also tried to run the app with mulidex disabled and it still works



来源:https://stackoverflow.com/questions/33929298/java-util-zip-zipexception-duplicate-entry-abstracthttpcontent-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!