duplicate files during packaging - android

I can not add a tube to the library I want to cache error, how do I resolve it?
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK builddef.lst
File1: C:\Users\Sims2.gradle\caches\modules-2\files-2.1\com.googlecode.mp4parser\isoparser\1.1.20\44b7ee9785227a29db4048ee36758ffa553b749e\isoparser-1.1.20.jar
File2: C:\Users\Sims2.android\build-cache\ac4f8b61ef7112ca250eee2e786463e96f1ea27c\output\jars\classes.jar
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "*******"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'jp.wasabeef:recyclerview-animators:2.2.3'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.hanks:htextview-rainbow:0.1.1'
compile 'com.hanks:htextview-typer:0.1.1'
compile 'com.google.firebase:firebase-ads:11.0.0'
compile 'com.scottyab:aescrypt:0.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'jp.wasabeef:glide-transformations:2.0.2'
compile 'com.squareup.picasso:picasso:2.5.1'
compile 'cn.pedant.sweetalert:library:1.3'
compile 'life.knowledge4:k4l-video-trimmer:1.0'
compile 'com.iceteck.silicompressorr:silicompressor:2.0'
testCompile 'junit:junit:4.12'
}

Just add packagingOptions { exclude 'builddef.lst' } to your gradle file - it should be enough.
Full version:
android {
compileSdkVersion 26
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "*******"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'builddef.lst'
}
}

Related

execution failed for tasks: multiple dex files define for appcompat version

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.example.ceinfo.firebaseproject"
minSdkVersion 15
targetSdkVersion 19
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:27.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
When I want to execute espresso test run, it shows me an error of multiple dex files define, I have set my appcompat version to 27.0.0, please suggest me solution to this error.

Multiple dex files define-volley

error when build apk....
[enter image description here][1]
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/android/volley/VolleyError;
my gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.morten.gpibwal.desakayuambon"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'com.github.bumptech.glide:volley-integration:1.4.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
}
The solution is
delete "compile 'com.github.bumptech.glide:volley-integration:1.4.0'
com.android.dex.DexException: Multiple dex files define
Lcom/android/volley/VolleyError;
You should delete
compile 'com.github.bumptech.glide:volley-integration:1.4.0'
Then Clean-Rebuild-Run.
add multiDexEnabled true in gradle file also use same version for compile dependencies check below code
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.morten.gpibwal.desakayuambon"
minSdkVersion 17
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 {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'com.github.bumptech.glide:volley-integration:1.4.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.0.0'
compile 'com.android.support:design:25.0.0'
testCompile 'junit:junit:4.12'
}
remove unnecessary empty
dexOptions {
}

APK version code is 3 but still i get error " You need to use a different version code for your APK because you already have one with version code 1."

I have uploaded apk with versionCode 3,versionName "1.0.3" but PlayStore gives me error with
Upload failed You need to use a different version code for your APK
because you already have one with version code 1.
Here is my GradleFile:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "netsol.xxxx.xxx"
minSdkVersion 16
targetSdkVersion 25
versionCode 3
versionName "1.0.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
dexOptions {
preDexLibraries false
javaMaxHeapSize "4g"
incremental true
dexInProcess = true
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
testCompile 'junit:junit:4.12'
}

Execution failed ':app:transformClassesWithJarMergingForDebug' duplicate entry: android/support/v4/graphics/drawable/DrawableCompat.class

I have this issue. How should I solve it?
build.gradle:
apply plugin: 'com.android.application'
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 25
buildToolsVersion "25.0.3"
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4' }
defaultConfig {
applicationId "com.solodroid.ecommerce"
minSdkVersion 15
targetSdkVersion 25
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'])
compile files('libs/android-support-v4.jar')
compile files('libs/Parse-1.3.0.jar')
compile files('libs/signpost-commonshttp4-1.2.1.2.jar')
compile files('libs/signpost-core-1.2.1.2.jar')
compile files('libs/signpost-jetty6-1.2.1.2.jar')
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:25.3.1'
}
TODO:
Remove configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }
Remove compile fileTree(dir: 'libs', include: ['*.jar'])
Convert all Jars to be Maven dependencies
Here
apply plugin: 'com.android.application'
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.solodroid.ecommerce"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile files('libs/Parse-1.3.0.jar')
compile files('libs/signpost-commonshttp4-1.2.1.2.jar')
compile files('libs/signpost-core-1.2.1.2.jar')
compile files('libs/signpost-jetty6-1.2.1.2.jar')
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:25.3.1'
}

java.util.zip.ZipException: duplicate entry: android/support/v4/view/KeyEventCompatEclair.class

Error:Execution failed for task ':jobFlexwithInvoice:packageAllDebugClassesForMultiDex'.
java.util.zip.ZipException:duplicateentry:android/support/v4/view/MotionEventCompatEclair.class
i have this problem and my gradle file is,
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "com.studity.socet_store"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//compile files('libs/android-support-v4.jar')
compile 'com.android.support:design:22.2.0'
compile files('libs/Parse-1.3.0.jar')
compile files('libs/signpost-commonshttp4-1.2.1.2.jar')
compile files('libs/signpost-core-1.2.1.2.jar')
compile files('libs/signpost-jetty6-1.2.1.2.jar')
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:support-v4:22.2.0'
}
what should i do!?
Try this..
compile ('com.android.support:support-v4:22.2.0') {
exclude module: 'support-v4'
}
Instead of
compile 'com.android.support:support-v4:22.2.0'
or exclude module: to other where problem create

Categories

Resources