Error:Execution failed for task :app:transformClassesWithJarMergingForDebug - android

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzbtk.class
When I run our android studio project these errors come up. How could I solve them?
My gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.shikshamela.shikshamela"
minSdkVersion 15
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 {
preDexLibraries = false
}
}
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.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.google.android.gms:play-services-auth:10.2.1'
compile 'com.google.firebase:firebase-messaging:10.2.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.shikshamela.shikshamela"
minSdkVersion 15
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 {
preDexLibraries = false
}
}
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.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.google.android.gms:play-services-auth:10.2.1'
compile 'com.google.firebase:firebase-messaging:10.2.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

try this change
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:25.3.1'
compile 'com.google.android.gms:play-services-auth:25.3.1'
compile 'com.google.firebase:firebase-messaging:25.3.1'
compile 'com.google.firebase:firebase-core:25.3.1'
compile 'com.google.firebase:firebase-auth:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'
To
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:25.3.1'
compile 'com.google.android.gms:play-services-auth:25.3.1'
compile 'com.google.firebase:firebase-messaging:10.2.1'
compile 'com.google.firebase:firebase-core:10.2.1'
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'

Make dependent jars compatible, so update these two latest version.
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
Update to
compile 'com.google.firebase:firebase-core:10.2.1'
compile 'com.google.firebase:firebase-auth:10.2.1'

// copy paste below code
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.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.1'
compile 'com.google.android.gms:play-services-auth:10.2.1'
compile 'com.google.firebase:firebase-messaging:10.2.1'
compile 'com.google.firebase:firebase-core:10.2.1'
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'
}

Related

It's showing error while building the app

When I'm trying to build my app it's building process is stopped showing the following message in logcat it's showing error
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/lucasr/twowayview/BuildConfig.class
My build.gradle file is
android {
compileSdkVersion 25
buildToolsVersion '26.0.1'
defaultConfig {
applicationId "community.infinity"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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.support:appcompat-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.android.support:support-v4:25.3.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.adamstyrc.cookiecutter:cookie-cutter:1.0.2'
compile 'com.allattentionhere:fabulousfilter:0.0.3'
compile 'com.github.florent37:diagonallayout:1.0.6'
compile 'com.flaviofaria:kenburnsview:1.0.7'
compile 'com.github.developer-shivam:FeaturedRecyclerView:1.0.0'
compile 'com.xujinyang.BiuEditText:library:1.4.1'
compile 'com.vstechlab.easyfonts:easyfonts:1.0.0'
compile 'gun0912.ted:tedbottompicker:1.0.12'
compile 'com.github.nkzawa:socket.io-client:0.5.2'
compile group: 'com.google.code.gson', name: 'gson', version: '2.3.1'
compile 'org.lucasr.twowayview:twowayview:0.1.4'
compile 'org.lucasr.twowayview:core:1.0.0-SNAPSHOT#aar'
compile 'org.lucasr.twowayview:layouts:1.0.0-SNAPSHOT#aar'
compile 'com.android.support:multidex:1.0.1'
testCompile 'junit:junit:4.12'
}
You are using the SNAPSHOT version :
compile 'org.lucasr.twowayview:core:1.0.0-SNAPSHOT#aar'
compile 'org.lucasr.twowayview:layouts:1.0.0-SNAPSHOT#aar'
and the STABLE version both at the same time
compile 'org.lucasr.twowayview:twowayview:0.1.4'
Try removing any of them. You should only use one at a time.
Visit:
https://github.com/lucasr/twoway-view

Build.Gradle (Module App ) unknown property

I have encountered this problem while syn of Gradle
This is the Code of build.gradle(Module app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "ahmedchtn.smartschool"
minSdkVersion 15
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'
}
}
}
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'
})
//RecyclerView
//retrofit,gson
//glide
compile
'com.github.bumptech.glide:glide:3.7.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'compile
'com.github.bumptech.glide:glide:3.7.0'compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
testCompile 'junit:junit:4.12'
}
I have tried to deleted some lines of compile but I did not arrive to resolve the problem,
You have few typos in your file:
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:appcompat-v7:25.3.1'
You should not have line break after compile.
Typical structure of dependencies block is:
dependencies {
// production
compile 'group:name:version'
// for local tests
testCompile 'group:name:version'
// for tests on device / emulator
androidTestCompile 'group:name:version'
}
If you really want to have line break (I don't even know why) you have to explicitly add parentheses around dependency definition:
compile (
'com.github.bumptech.glide:glide:3.7.0'
)
Change it to this.
compile 'com.github.bumptech.glide:glide:3.7.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'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
testCompile 'junit:junit:4.12'

Buttknife not working with RXJava

Have problems with two libraries.
Gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "pe.com.gmd.innova.adexus.adexusday"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
/*
greendao {
schemaVersion 7
}*/
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(name: 'androidgmd2', ext: 'aar')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:multidex:1.0.1'
compile 'org.greenrobot:greendao:3.2.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.androidanimations:library:1.1.3#aar'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.viewpagerindicator:library:2.4.1#aar'
compile 'com.google.android.gms:play-services-location:10.2.1'
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.firebase:firebase-crash:10.0.1'
compile 'com.google.code.gson:gson:2.8.0'
compile 'me.dm7.barcodescanner:zbar:1.9.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'
compile 'io.reactivex:rxandroid:1.2.0'
compile 'io.reactivex:rxjava:1.1.8'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
}
apply plugin: 'com.google.gms.google-services'
not have problems with gradle process any error..
so have problems in ejecuttion application.. because my buttknife not working injection.
Maybe exist version so working fine with rxjava librarys ? or the version is really low
my version library compile 'com.jakewharton:butterknife:7.0.1'
It looks like you are not importing AnnotationProcessor.
Try this with latest versions:
compile 'com.jakewharton:butterknife:8.6.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'

Duplicate entry error ByteOrderMark.class

i was getting the multidex error so, i enabled it and now i am getting this error :`
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/commons/io/ByteOrderMark.class
gradle.build
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.test"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [appPackageName: "com.example.test"]
}
android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
}
}
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.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.firebase:firebase-ads:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.firebase:firebase-client-android:2.5.2'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.adobe.creativesdk.foundation:auth:0.9.1251'
compile 'com.adobe.creativesdk:image:4.8.4'
compile 'com.localytics.android:library:3.8.0'
compile 'com.ramotion.foldingcell:folding-cell:1.0.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.easing:library:1.0.1#aar'
compile 'com.daimajia.androidanimations:library:1.1.3#aar'
compile 'com.daimajia.numberprogressbar:library:1.2#aar'
compile 'com.github.javiersantos:BottomDialogs:1.2.1'
compile 'com.github.Yalantis:GuillotineMenu-Android:1.2'
compile 'com.github.hotchemi:permissionsdispatcher:2.0.7'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.eyalbira.loadingdots:loading-dots:1.0.2'
testCompile 'junit:junit:4.12'
apt 'com.github.hotchemi:permissionsdispatcher-processor:2.0.7'
}
apply plugin: 'com.google.gms.google-services'
`
I was also facing the same issue
after searching i found this solution
It is the duplicate issue
configurations {
all*.exclude group: 'commons-io'
}
Check this link
https://stackoverflow.com/a/36301313/6272799

I am Suddenly getting Play-Service-app-indexing:10.0.1 error in gradle of android Studio

Error:(41, 13) Failed to resolve: com.google.android.gms:play-services-appindexing:10.0.1
Here is my build.gradle file of my project in Android Studio, the errors has came suddenly.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.example.pandey.nidhiiot"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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.google.android.gms:play-services:10.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:design:25.1.1'
compile 'com.google.firebase:firebase-appindexing:10.0.0'
testCompile 'junit:junit:4.12'
apk 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:25.1.1-beta1'
// Glide image library
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.android.gms:play-services-appindexing:10.0.1'
}
apply plugin:'com.google.gms.google-services'
Referring to this post, you should remove
compile 'com.google.android.gms:play-services-appindexing:10.0.1'
since using the new library dependency (below) should be enough.
compile 'com.google.firebase:firebase-appindexing:10.0.0'
I copied the part of your gradle file for dependencies and encountered the same. After removing the duplicate (compile 'com.google.android.gms:play-services:10.0.1') and replacing the dependency as mentioned above, the build was successful.
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.github.bumptech.glide:glide:3.7.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:design:25.1.1'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
testCompile 'junit:junit:4.12'
apk 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:25.1.1-beta1'
// Glide image library
compile 'com.github.bumptech.glide:glide:3.7.0'
}
You have
compile 'com.google.firebase:firebase-appindexing:10.0.0'
compile 'com.google.android.gms:play-services-appindexing:10.0.1'
Check if just one of them is necessary.
Also check changing firebase-appindexing to 10.0.1
Try this may be helpful
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.example.pandey.nidhiiot"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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.google.android.gms:play-services:10.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:design:25.1.1'
compile 'com.google.firebase:firebase-appindexing:10.0.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.android.gms:play-services-appindexing:10.0.1'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile 'com.android.support:support-v4:25.1.0'
testCompile 'junit:junit:4.12'
// Glide image library
compile 'com.github.bumptech.glide:glide:3.7.0'
}
apply plugin:'com.google.gms.google-services'

Categories

Resources