问题描述
我不知道为什么我得到这个错误。任何形式的帮助都将非常可观。
错误:任务':packageAllDebugClassesForMultiDex'的执行失败。
继承我的应用程序/ gradle文件
<$ p
$ b $
编译fileTree(包括'* .jar',dir:'libs')
编译'com.android.support:appcompat-v7:23.1.1'
编译'com.google .android:annotations:4.1.1.4'
}
buildscript
{
存储库
{
mavenCentral ()
}
依赖关系
{
classpath'com.android.tools.build:gradle:1.3.0'
}
}
全部项目
{
存储库
{
jcenter()
maven
{
url
}
}
}
android
{
compileSdkVersion 23
buildToolsVersion '23 .0.2'
useLibrary'org.apache.http.legacy '
android
{
packagingOptions
{
exclude'META-INF /NOTICE.txt'
排除'META-INF / LICENSE.txt'
排除'META-INF / DEPENDENCIES.txt'
排除'META-INF / LICENSE.txt'
排除'META-INF / NOTICE.txt'
排除'META-INF / DEPENDENCIES'
排除'META-INF / LICENSE'
排除'META-INF / NOTICE'
排除'LICENSE.txt'
}
}
defaultConfig
{
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize2g
}
sourceSets {
main {
manifest.srcFile'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
$ b instrumentTest.setRoot('tests')
debug.setRoot('build-types / debug')
release.setRoot('build-types / release' )
}
存储库{
flatDir {
dirs'libs'
}
}
依赖关系{
编译'io.card:card.io:5.0.1@aar'
编译项目(':star')
编译项目(':zxing-android-embedded')
compile'io.payworks:mpos.android.ui:2.7.0:@aar'
compile'io.payworks:mpos.android.core:2.7.0:@aar'
compile' io.payworks:mpos.android.accessories.miura:2.7.0:@aar'
compile'io.payworks:mpos.android.comlinks.bluetooth:2.7.0:@aar'
compile' io.payworks:mpos.android.accessories.verifone-e105:2.7.0:@aar'
compile'io.payworks:mp os.android.comlinks.verifone-e105:2.7.0:@aar'
compile'io.payworks:mpos.android.accessories.sewoo:2.7.0:@aar'
compile'com。 google.android.gms:play-services:8.4.0'
compile'com.android.support:support-v4:23.1.1'
compile'com.android.support:cardview-v7: 23.1.1'
compile'com.squareup:otto:1.3.5'
compile'com.squareup.okhttp:okhttp:2.7.2'
compile'com.parse.bolts:
compile'com.fasterxml.jackson.core:jackson-databind:2.4.4'
compile'com.verifone:verifone-pwmadk:3.0.2@aar'
compile'com.android.support:multidex:1.0.1'
compile'com.google.android.gms:play-services-ads:8.4.0'
compile'com。 google.android.gms:play-services-identity:8.4.0'
compile'com.google.android.gms:play-services-gcm:8.4.0'
}
dexOptions {
preDexLibraries = false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
我不确定它是否可行,但您可以尝试使用 DuplicationStrategy
()如下所示:
packageAllDebugClassesForMultiDex {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
I am not sure why I am getting this error. Any kind of help will be highly appreciable
Error:Execution failed for task ':packageAllDebugClassesForMultiDex'.
heres my app/gradle file
apply plugin: 'android'
dependencies{ compile fileTree(include: '*.jar', dir: 'libs') compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.google.android:annotations:4.1.1.4'}
buildscript{ repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:1.3.0' }}allprojects{ repositories { jcenter() maven { url "http://releases.payworks.io/artifactory/mpos" } }}android{ compileSdkVersion 23 buildToolsVersion '23.0.2' useLibrary 'org.apache.http.legacy'
android
{
packagingOptions
{
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'LICENSE.txt'
}
}
defaultConfig
{
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "2g"
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compile 'io.card:card.io:5.0.1@aar'
compile project(':star')
compile project(':zxing-android-embedded')
compile 'io.payworks:mpos.android.ui:2.7.0:@aar'
compile 'io.payworks:mpos.android.core:2.7.0:@aar'
compile 'io.payworks:mpos.android.accessories.miura:2.7.0:@aar'
compile 'io.payworks:mpos.android.comlinks.bluetooth:2.7.0:@aar'
compile 'io.payworks:mpos.android.accessories.verifone-e105:2.7.0:@aar'
compile 'io.payworks:mpos.android.comlinks.verifone-e105:2.7.0:@aar'
compile 'io.payworks:mpos.android.accessories.sewoo:2.7.0:@aar'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.squareup:otto:1.3.5'
compile 'com.squareup.okhttp:okhttp:2.7.2'
compile 'com.parse.bolts:bolts-android:1.2.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.4'
compile 'com.verifone:verifone-pwmadk:3.0.2@aar'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.android.gms:play-services-identity:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
}
dexOptions {
preDexLibraries = false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
I am not sure if it will work, but you could try using a DuplicationStrategy
(https://docs.gradle.org/current/javadoc/org/gradle/api/file/DuplicatesStrategy.html) like so:
packageAllDebugClassesForMultiDex {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
这篇关于java.util.zip.ZipException:重复条目:com / google / zxing / BarcodeFormat.class的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!