构建Android应用程序时出现gradle错误。我收到了以下错误:
Error:Execution failed for task ':app:transformClassesWithJarMergingForNVOLVDebug'.
com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / google / myjson / stream / MalformedJsonException.class
任何形式的帮助都将受到高度赞赏。
应用/ gradle这个
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
useLibrary 'org.apache.http.legacy'
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
defaultConfig {
applicationId "com.app.iqvis.nvolv_cleanup"
minSdkVersion 16
targetSdkVersion 23
versionCode 2
versionName "2.1"
multiDexEnabled true
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
ndk {
abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
}
}
productFlavors {
NVOLV {
applicationId "com.app.iqvis.nvolv"
copy {
from 'src/main/'
include '*.json'
into '.'
}
versionCode 51
versionName "2.0.2"
}
ISNA {
applicationId "com.app.iqvis.isna"
// manifest.srcFile "isna/AndroidMenifest.xml"
}
ARNOVA {
applicationId "com.app.iqvis.arnova"
}
PERISCOPE {
applicationId "com.app.iqvis.periscope"
}
SAN {
applicationId "com.app.iqvis.sanjosejazz"
}
OHIO {
applicationId 'com.app.iqvis.ohioaeyc'
copy {
from 'src/OHIO/'
include '*.json'
into '.'
}
versionCode 32
versionName '1.992'
}
BeckersHealthCare {
applicationId 'com.app.iqvis.beckershealthcare'
copy {
from 'src/BeckersHealthCare/'
include '*.json'
into '.'
}
versionCode 32
versionName '1.91'
}
NPCenter {
applicationId 'com.app.iqvis.npcenter'
copy {
from 'src/NPCenter/'
include '*.json'
into '.'
}
versionCode 32
versionName '1.7'
}
NVOLVDev {
applicationId "com.app.iqvis.nvolvdev"
copy {
from 'src/NVOLVDev/'
include '*.json'
into '.'
}
versionCode 19
versionName "2.39"
}
WSCPA {
applicationId "com.app.iqvis.wscpa"
copy {
from 'src/WSCPA/'
include '*.json'
into '.'
}
versionCode 32
versionName "1.2"
}
UMAA {
applicationId "com.app.iqvis.umaa"
copy {
from 'src/UMAA/'
include '*.json'
into '.'
}
versionCode 32
versionName "1.1"
}
SFDW {
applicationId "com.app.iqvis.sfdw"
copy {
from 'src/SFDW/'
include '*.json'
into '.'
}
versionCode 3
versionName "1.96"
}
CALCPA {
applicationId 'com.app.iqvis.calcpa'
copy {
from 'src/CALCPA/'
include '*.json'
into '.'
}
versionCode 2
versionName '1.1'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
repositories {
maven { url 'http://repo1.maven.org/maven2' }
mavenCentral()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile files('libs/zbar.jar')
compile files('libs/android-volley-master-1.0.15.jar')
compile files('libs/Branch-1.10.8.jar')
// compile files('libs/ormlite-core-4.41.jar')
compile files('libs/sugar-1.3.jar')
compile files('libs/google-api-client-1.17.0-rc.jar')
// compile files('libs/sinch-android-rtc-3.6.1.jar')
compile files('libs/google-api-services-urlshortener-v1-rev22-1.17.0-rc.jar')
compile files('libs/crittercism_v5_3_3_sdkonly.jar')
// compile files('libs/httpmime-4.1.3.jar')
compile files('libs/google-http-client-1.17.0-rc.jar')
// compile files('libs/ormlite-android-4.41.jar')
// compile files('libs/nvolvlib.jar')
provided files('libs/myjson-2.3.1.jar')
compile files('libs/google-http-client-android-1.17.0-rc.jar')
compile files('libs/iqvisanalytics.jar')
compile files('libs/stickygridheaders.jar')
compile files('libs/google-api-client-android-1.17.0-rc.jar')
// compile files('libs/commSinch.jar')
compile project(':resideMenu')
compile project(':library')
compile project(':nvolvlib')
compile project(':extensiblepageindicator')
compile project(':ahbottomnavigation')
compile project(':commSinch')
compile project(':fab')
compile files('libs/gentlyWEB-utils-1.1.jar')
compile files('libs/JoSQL-2.2.jar')
// compile 'com.android.support:recyclerview-v7:23.0.0'
// compile 'com.android.support:cardview-v7:23.0.0'
compile'joda-time:joda-time:2.7'
compile'com.google.android.gms:play-services:8.4.0'
compile'com.squareup.picasso:picasso:2.5.2'
compile'me.leolin:ShortcutBadger:1.1.3@aar'
compile'com.parse.bolts:bolts-android:1.+'
compile'com.parse:parse-android:1.+'
compile 'com.github.traex.rippleeffect:library:1.3'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
compile 'com.google.android.gms:play-services-identity:8.4.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.roughike:bottom-bar:1.2.1'
compile 'com.google.guava:guava:19.0'
compile 'com.ms-square:expandableTextView:0.1.4'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
}
nvolvlib gradle文件:
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.0'
compile files('libs/httpmime-4.1.3.jar')
compile files('libs/ormlite-core-4.43.jar')
compile files('libs/ormlite-android-4.43.jar')
compile files('libs/myjson-2.3.1.jar')
}
答案 0 :(得分:1)
试试这个。
dependencies {
testCompile 'junit:junit:4.12'
compile files('libs/zbar.jar')
compile files('libs/android-volley-master-1.0.15.jar')
compile files('libs/Branch-1.10.8.jar')
// compile files('libs/ormlite-core-4.41.jar')
compile files('libs/sugar-1.3.jar')
compile files('libs/google-api-client-1.17.0-rc.jar')
// compile files('libs/sinch-android-rtc-3.6.1.jar')
compile files('libs/google-api-services-urlshortener-v1-rev22-1.17.0-rc.jar')
compile files('libs/crittercism_v5_3_3_sdkonly.jar')
// compile files('libs/httpmime-4.1.3.jar')
compile files('libs/google-http-client-1.17.0-rc.jar')
// compile files('libs/ormlite-android-4.41.jar')
// compile files('libs/nvolvlib.jar')
// provided files('libs/myjson-2.3.1.jar')
compile files('libs/google-http-client-android-1.17.0-rc.jar')
compile files('libs/iqvisanalytics.jar')
compile files('libs/stickygridheaders.jar')
compile files('libs/google-api-client-android-1.17.0-rc.jar')
// compile files('libs/commSinch.jar')
compile project(':resideMenu')
compile project(':library')
compile project(':nvolvlib')
compile project(':extensiblepageindicator')
compile project(':ahbottomnavigation')
compile project(':commSinch')
compile project(':fab')
compile files('libs/gentlyWEB-utils-1.1.jar')
compile files('libs/JoSQL-2.2.jar')
// compile 'com.android.support:recyclerview-v7:23.0.0'
// compile 'com.android.support:cardview-v7:23.0.0'
compile 'joda-time:joda-time:2.7'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'me.leolin:ShortcutBadger:1.1.3@aar'
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.+'
compile 'com.github.traex.rippleeffect:library:1.3'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
compile 'com.google.android.gms:play-services-identity:8.4.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.roughike:bottom-bar:1.2.1'
compile 'com.google.guava:guava:19.0'
compile 'com.ms-square:expandableTextView:0.1.4'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
nvolvlib grdle文件中的
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.0'
compile files('libs/httpmime-4.1.3.jar')
compile files('libs/ormlite-core-4.43.jar')
compile files('libs/ormlite-android-4.43.jar')
compile files('libs/myjson-2.3.1.jar')
}