Duplicate entry error ByteOrderMark.class - android

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

Related

error when adding compile 'com.google.android.gms:play-services:11.0.1'

I have an error when I put
compile 'com.google.android.gms:play-services:11.0.1'
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "eyaa.compsproject"
minSdkVersion 16
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.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services:11.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
why red in line
compile 'com.android.support:appcompat-v7:25.3.1'
when using
compile 'com.google.android.gms:play-services:11.0.1'
The play service and firebase version needed to be same,
Please replace with below code and check.
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'

Adding Uber Dependency gives error to my app

I'm trying to integrate uber in my mobile application.
When I try to add the dependency:
compile 'com.uber.sdk:rides-android:0.6.1'
This is my gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.sumo.traffic"
minSdkVersion 18
targetSdkVersion 25
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
dexOptions {
javaMaxHeapSize "4g"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':library2')
compile('com.google.http-client:google-http-client-jackson2:1.21.0') {
exclude group: 'org.apache.httpcomponents'
}
compile('com.google.api-client:google-api-client-android:1.17.0-rc') {
exclude module: 'httpclient'
}
compile('com.google.http-client:google-http-client-gson:1.17.0-rc') {
exclude module: 'httpclient'
}
compile project(path: ':Expandablelayout-library')
compile project(':compoundlayout')
// compile 'com.google.android.gms:play-services-appindexing:10.0.1'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile 'com.sun.mail:android-mail:1.5.5'
compile 'com.sun.mail:android-activation:1.5.5'
compile 'com.uncopt:android.justified:1.0'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.google.android.gms:play-services:11.0.2'
compile 'com.google.maps.android:android-maps-utils:0.4.4'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.maps:google-maps-services:0.1.17'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.7.5'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.7.5'
compile 'io.reactivex:rxjava:1.0.17'
compile 'io.reactivex:rxandroid:0.23.0'
compile 'com.squareup.okio:okio:1.1.0'
compile 'me.relex:circleindicator:1.2.2#aar'
compile 'de.keyboardsurfer.android.widget:crouton:1.8.5#jar'
compile 'com.google.android.gms:play-services-ads:11.0.2'
compile 'com.google.android.gms:play-services-auth:11.0.2'
compile 'com.google.android.gms:play-services-gcm:11.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.github.bluejamesbond:textjustify-android:2.1.6'
testCompile 'junit:junit:4.12'
}
repositories {
mavenCentral()
}
When I try to add uber dependency, it crashing the app.
But when I remove the uber dependency. Everything works.
I have no idea what's happening.
Unchecking instant - run fixed this.

failed to resolve compile 'com.android.support:cardView-v7:25.3.1'

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

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformExceptionduplicate entry:

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 .

Error:Execution failed for task :app:transformClassesWithJarMergingForDebug

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'
}

Categories

Resources