Google app engine 重复条目:AbstractHttpContent.class
我正在开发一个应用程序,使用谷歌应用程序引擎。 建筑很好,但当我试着运行它时, 我得到这个错误:Google app engine 重复条目:AbstractHttpContent.class,google-app-engine,Google App Engine,我正在开发一个应用程序,使用谷歌应用程序引擎。 建筑很好,但当我试着运行它时, 我得到这个错误: Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/appengine/repac
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/appengine/repackaged/com/google/api/client/http/AbstractHttpContent.class
尝试在android studio中运行应用程序时
这是我的毕业证书:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "bgu.wingmanapp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
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.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile project(path: ':backend', configuration: 'android-endpoints')
compile ('com.google.appengine:appengine-api-1.0-sdk:1.9.18')
compile ('com.google.appengine:appengine-endpoints:1.9.18')
}
和后台gradle:
// If you would like more information on the gradle-appengine-plugin please refer to the github page
// https://github.com/GoogleCloudPlatform/gradle-appengine-plugin
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
}
}
我知道我有一个复杂的依赖关系,但我不能解决它。谢谢 如果您编译此项目:
compile project(path: ':backend', configuration: 'android-endpoints')
如果您运行下面两个程序,那么您将拥有上面编译的项目的副本。您应该删除它们:
compile ('com.google.appengine:appengine-api-1.0-sdk:1.9.18')
compile ('com.google.appengine:appengine-endpoints:1.9.18')
此外,如果您正在使用:
compile fileTree(dir: 'libs', include: ['*.jar'])......(I am aware you have commented it out)
您可能还有与“应用程序”或“后端”模块中相同的外部库文件,由于编译整个文件树,这些模块被调用了两次。您是否解决了此问题?删除此文件完成了以下工作:编译文件树(dir:'libs',include:['*.jar']),从4小时以来一直在与此错误作斗争。谢谢