I am using android studio 2.3.1, In android build.gradle
compile 'com.android.support:appcompat-v7:23.4.0'
has error
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 24.0.0, 23.4.0. Examples include com.android.support:support-v4:24.0.0 and com.android.support:animated-vector-drawable:23.4.0
This is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.wsolus.chathuranga.simplifya"
minSdkVersion 16
targetSdkVersion 23
versionCode 22
versionName "2.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
} } 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('org.apache.httpcomponents:httpmime:4.3') {
exclude module: "httpclient"
}
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
}
please help me
Thanks
This is a screen shot of the gradle:
Change your gradle file like this and then go to file->Invalidate cache and restart.
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.wsolus.chathuranga.simplifya"
minSdkVersion 16
targetSdkVersion 23
versionCode 22
versionName "2.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
} } 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('org.apache.httpcomponents:httpmime:4.3') {
exclude module: "httpclient"
}
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:support-v4:24.2.0'
compile 'com.android.support:palette-v7:24.2.0'
}
You are currently using
compileSdkVersion 23
buildToolsVersion '25.0.0'
First Change your CompileSDK and build tool version to
compileSdkVersion 25
buildToolsVersion '25.0.2'
And Change Your dependancy to
Comment your appcompat dependancy and version up to your other dependancy.
I also got this error. this will work for me.
//compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
thank you :)
Related
I am trying to execute my firebase based application which is giving me following error
Update 1- I Updated multiDexEnabled to true also included packagingOptions but getting this error:
error log - Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
-> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzblr.class
My app-level build.gradle:-
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.multiplexerx.smartjournal"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
buildTypes {
release {
minifyEnabled true
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.github.chyrta:AndroidOnboarder:0.7'
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.android.gms:play-services-auth:10.2.1'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-database:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Makes sure that you're using the same library version for all of Firebase (and play services):
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.android.gms:play-services-auth:10.2.1'
compile 'com.google.firebase:firebase-database:10.2.1'
I'm using Android Studio 2.2.3
I'm Having troubles with using okhttp, and it's always giving me:
Error:(49, 13) Failed to resolve: com.squareup.okhttp3:okhttp:3.2.0
Even when i try to import it, and error will show under the line.
This is the gradle:
apply plugin: 'com.android.application'
android {
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
compileSdkVersion 25
buildToolsVersion "25.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.example.yara.prototype"
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 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.firebase:firebase-client-android:2.5.0'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-crash:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.android.support:design:25.0.1'
testCompile 'junit:junit:4.12'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
}
repositories {
jcenter()
maven { url "https://jitpack.io" }
mavenCentral()
}
apply plugin: 'com.google.gms.google-services'
I am working on an android app. every time i try to run this app I get 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/auth/api/signin/internal/zzf.class.**"
I have tried all solutions in this and other forums but nothing works.
this is my build.gradle(module:app). thanks in advance.
apply plugin: 'com.android.application'
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
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'
}
dexOptions {
javaMaxHeapSize "4g"
}
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "etc.solved.problem.gideon.androidalertapp"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
configurations {
all*.exclude group: 'com.android.support', module: 'play-services-tasks-10.0.1'
}}
ependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//compile 'com.parse:parse-android:1.10.3'
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.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.firebase:firebase-client-android:2.5.2'
compile 'com.android.support:multidex:1.0.1'
compile 'com.firebaseui:firebase-ui:1.0.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
You are using com.firebase:firebase-client-android:2.5.2 and the new SDK, com.google.firebase:firebase-database:10.0.1. You cannot use them together in the same app.
check out firebase doc
I'm getting an exception in Android Studio while build project
Error:Execution failed for task
':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException:
java.util.zip.ZipException: duplicate entry:
android/support/v4/view/LayoutInflaterFactory.class
My gradle file is-
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.amt.partnerapp"
minSdkVersion 15
targetSdkVersion 23
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'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
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:appcompat-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha1'
compile 'com.android.support:design:23.4.0'
testCompile 'junit:junit:4.12'
compile files('libs/activation.jar')
compile 'com.google.android.gms:play-services:9.2.0'
compile 'com.android.support:multidex:1.0.0'
compile "com.android.support:support-v4:23.4.0"
}
com.google.android.gms:play-services:9.2.0 depends on different version of support libraries than you provided. You can check it here
Try to exclude support dependencies from it. Like that:
compile ('com.google.android.gms:play-services:9.2.0') {
exclude group: 'com.android.support', module: 'support-v4'
}
I get the error
"Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: android/support/v4/content/ContextCompatKitKat.class"
I am using apache jars for httpclient and android-support-v4.jar.
I am really new to this and am not sure why i am getting this error.
my build.gradle looks this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
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.example.petersenrr.test"
minSdkVersion 8
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
//compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile files('libs/android-support-v4.jar')
compile files('libs/httpclient-android-4.3.5.jar')
compile files('libs/httpclient-4.5.2.jar')
compile files('libs/httpcore-4.4.4.jar')
}
During gradle sync it is fine, just when i try to run it do i get this error.
Any help is appreciated
Thanks