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
Related
This is my project code I am getting an error of
failed to resolve: compile 'com.android.support:cardView-v7:25.3.1'
I have reinstalled Android support Repository (rev 47 ) but it didn't work and still giving me the error.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
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'
}
}
}
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.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.android.support:design:25.3.1'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:support-core-utils:25.4.0'
compile 'com.android.support:cardView-v7:25.3.1'
testCompile 'junit:junit:4.12'
}
You have capitalised 'v' in cardview.
Change
compile 'com.android.support:cardView-v7:25.3.1'
to
compile 'com.android.support:cardview-v7:25.3.1'
On a side note, please use the same version for all dependencies in a single group. For example, use 25.4.0 for all dependencies in group com.android.support
I am working with firebase notification and since this noon i am getting this error.
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/gcm/PendingCallback$1.class
Build.gradle
apply plugin: 'com.android.application'
apply from: 'config.gradle'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "********"
minSdkVersion 17
targetSdkVersion 25
useLibrary 'org.apache.http.legacy'
versionCode 1
versionName "1.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
compileOptions {
}
aaptOptions {
cruncherEnabled = false
}
buildTypes {
release {
shrinkResources true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
android.buildTypes.each { type ->
type.buildConfigField 'String', 'CHAT_SERVER_URL', "\"$chatServerUrl\""
}
repositories {
jcenter()
maven {
url 'http://tokbox.bintray.com/maven'
}
maven {
url 'https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/'
}
}
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 files('libs/picasso-2.5.2.jar')
compile("com.quickblox:quickblox-android-sdk-chat:2.5.1#aar") {
transitive = true
}
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.android.support:cardview-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:support-v4:25.3.1'
compile 'me.himanshusoni.chatmessageview:chat-message-view:1.0.7'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.facebook.android:facebook-android-sdk:4.20.0'
compile 'at.blogc:expandabletextview:1.0.3'
compile 'com.github.aakira:expandable-layout:1.6.0#aar'
compile 'com.opentok.android:opentok-android-sdk:2.10.+'
compile 'com.google.android.gms:play-services-gcm:10.2.6'
compile 'com.google.firebase:firebase-auth:10.2.6'
// compile 'com.google.android.gms.internal.zzanb:10.2.6'
compile 'com.google.firebase:firebase-invites:10.2.6'
compile 'com.google.firebase:firebase-messaging:10.2.6'
compile 'com.google.firebase:firebase-core:10.2.6'
compile 'com.firebase:firebase-jobdispatcher:0.5.2'
compile 'com.firebaseui:firebase-ui:0.6.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.stripe:stripe-android:4.0.1'
compile 'com.parse:parse-android:1.13.0'
compile 'io.reactivex:rxjava:1.1.6'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
compile 'com.squareup.okio:okio:1.11.0'
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
compile 'com.github.bmelnychuk:atv:1.2.+'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
You have to remove compile 'com.google.android.gms:play-services-gcm:10.2.6' from your module gradle file .
PendingCallback is the class that duplicate in both Firebase and old GCM .
Once you remove 'com.google.android.gms:play-services-gcm:10.2.6' from your gradle file you will find some compile errors that depends on 'com.google.android.gms:play-services-gcm:10.2.6' .
You have to replace that code with new google Firebase API code .
Hope it help you .
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
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'
}
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'