After updating android studio and several dependencies i now get this error message
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzeg.class
this is my gradle file
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'com.google.firebase.firebase-perf'
android {
compileSdkVersion 26
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "REMOVED_FOR_PRIVACY"
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'
}
}
}
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
// These docs use an open ended version so that our plugin
// can be updated quickly in response to Android tooling updates
// We recommend changing it to the latest version from our changelog:
// https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
classpath 'io.fabric.tools:gradle:1.+'
}
}
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.firebaseui:firebase-ui:1.2.0'
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:mediarouter-v7:26.0.2'
compile 'com.google.android.gms:play-services-location:11.2.0'
compile 'com.google.firebase:firebase-core:11.2.0'
compile 'com.google.firebase:firebase-crash:11.2.0'
compile 'com.google.firebase:firebase-auth:11.2.0'
compile 'com.google.firebase:firebase-messaging:11.2.0'
compile 'com.google.firebase:firebase-database:11.2.0'
compile 'com.google.firebase:firebase-perf:11.2.0'
compile 'com.firebaseui:firebase-ui-auth:2.0.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:design:26.0.2'
compile 'com.github.bumptech.glide:glide:4.0.0'
compile 'com.android.support:support-v4:26.0.2'
compile 'com.android.support:multidex:1.0.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
I already tried Cleaning and Rebuilding the project but nothing seems to work
okay what seemed to actually work was replacing
'com.google.android.gms:play-services-location:11.2.0'
with
'com.google.android.gms:play-services:11.2.0'
Bump up your build tool version to:
buildToolsVersion "26.0.2"
And exclude Play Services from Facebook, for example
compile ('com.facebook.android:facebook-android-sdk:[4,5)'){
exclude group:"com.google.android.gms"
}
Related
Module app Gradle:
Updated the google repository and service from sdk too
but this error is still there. Please someone check it out
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.norsoftbd.user.test1vaia"
minSdkVersion 22
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 {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
//implementation 'com.google.android.gms:play-services:10.2.1'
implementation 'com.android.firebase:firebase-core:10.2.0'
implementation 'com.android.firebase:firebase-database:10.2.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
compile "com.android.support:recyclerview-v7:26.1.0"
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.firebase:firebase-messaging:10.2.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
apply plugin: 'com.google.gms.google-services'`enter code here`
Add the Google Maven repository in your project level build.gradele file as shown below.
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Within build.gradle(Project) file, add latest google-services and Google maven repository
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Then, in your build.gralde(Module:app) file, add latest Firebase dependencies, apply google-services plugin and fix android support dependecies version:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.norsoftbd.user.test1vaia"
minSdkVersion 22
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'])
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:recyclerview-v7:26.0.2'
compile 'com.android.support:cardview-v7:26.0.2'
compile 'com.android.support:design:26.0.2'
compile 'com.android.firebase:firebase-core:11.4.2'
compile 'com.android.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-messaging:11.4.2'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
apply plugin: 'com.google.gms.google-services'
Using configuration above should work.
Just replaced all "compile" with "implements" , #AlexTa I also placed the latest google services earlier.
I recently switched image loading libraries from Glide to Fresco and now I am unable to generate a signed apk.
I keep getting this error;
Execution failed for task ':app:transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Too many classes in --main-dex-list, main dex capacity exceeded
My Application class extends MultidexApplication, and I have the proguard-fresco.pro file included in my build.gradle.
Prior to using Fresco, my project built successfully each time but now i can't generate a signed apk. How can I mitigate this and get my project to build?
My build.gradle file is as follows:
buildscript {
repositories {
mavenCentral();
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.24.1'
classpath "com.newrelic.agent.android:agent-gradle-plugin:5.9.0"
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
apply plugin: 'newrelic'
apply plugin: 'me.tatarka.retrolambda'
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url "http://dl.bintray.com/glomadrian/maven" }
}
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.app.android"
minSdkVersion 19
targetSdkVersion 26
renderscriptTargetApi 20
renderscriptSupportModeEnabled true
versionCode 79
versionName "0.9.9"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
multiDexKeepProguard file("proguard.multidex.config")
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'proguard-fresco.pro'
}
}
retrolambda {
jvmArgs '-noverify'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
compile 'com.newrelic.agent.android:android-agent:5.9.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:cardview-v7:26.0.1'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.google.code.gson:gson:2.8.1'
compile 'com.google.android.exoplayer:exoplayer-core:r2.5.1'
compile 'com.google.android.exoplayer:exoplayer-dash:r2.5.1'
compile 'com.google.android.exoplayer:exoplayer-hls:r2.5.1'
compile 'com.google.android.exoplayer:exoplayer-ui:r2.5.1'
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.google.firebase:firebase-core:11.2.0'
compile 'io.realm:android-adapters:2.1.0'
compile 'org.parceler:parceler-api:1.1.6'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'com.andrognito.kerningview:kerningview:1.0.0'
compile 'com.flurry.android:analytics:6.4.2'
compile 'com.amazonaws:aws-android-sdk-core:2.6.0'
compile 'com.amazonaws:aws-android-sdk-pinpoint:2.6.0'
compile 'com.amazonaws:aws-android-sdk-sns:2.6.0'
compile 'com.google.android.gms:play-services-gcm:11.2.0'
compile 'com.wdullaer:materialdatetimepicker:3.1.3'
testCompile 'junit:junit:4.12'
annotationProcessor 'org.parceler:parceler:1.1.5'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile "com.mixpanel.android:mixpanel-android:5.1.4"
compile 'com.mani:ThinDownloadManager:1.3.0'
compile 'com.google.android:flexbox:0.3.0-alpha3'
compile 'com.airbnb:deeplinkdispatch:3.1.0'
annotationProcessor 'com.airbnb:deeplinkdispatch-processor:3.1.0'
compile 'com.facebook.fresco:fresco:1.5.0'
compile 'jp.wasabeef:fresco-processors:2.1.0'
}
apply plugin: 'com.google.gms.google-services'
I know this question is asked several times. I have been trying for over 3 hours with various solutions found but none of them worked for me.
When I run the application, it works well, but when I try to build APK it is giving me the following error:
Error:Execution failed for task
':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry:
com/google/android/gms/internal/zzcn$zza.class
I had taken the build successfully before I added firebase for FCM notification. After FCM was added, I had dex error, so I had to add support for multidex. I am also using YouTube player jar file.
This is my Gradle file:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.sample.application"
minSdkVersion 15
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.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
compile files('libs/YouTubeAndroidPlayerApi.jar')
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:support-v4:25.3.1'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.facebook.android:audience-network-sdk:4.+'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.android.support:multidex:1.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
The issue is that com.facebook.android:audience-network-sdk has dependency : play-services-ads:8.4.0 which doesn't match the 10.0.1 version
replace :
compile 'com.facebook.android:audience-network-sdk:4.+'
compile 'com.google.firebase:firebase-messaging:10.0.1'
with :
compile ('com.facebook.android:audience-network-sdk:4.+'){
exclude group: "com.google.android.gms"
}
compile 'com.google.android.gms:play-services-ads:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
I am facing a problem to compile Firebase in my android project.Here is my app level gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "<my_app_id>"
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'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'me.relex:circleindicator:1.2.2#aar'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.google.firebase:firebase-core:10.2.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
And here is the build gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I am getting an error of Failed to resolve : com.google.firebase:firebase-core:10.2.1
If you are using android studio,
Goto tools -> Firebase
And follow on screen instructions. Android studio take care of the dependency issues.
Change
compile 'com.google.android.gms:play-services-auth:10.2.1'
to
compile 'com.google.android.gms:play-services-auth:10.0.1'
It works for me.
update your play service version and also update firebase dependency version.
I am trying to create a chat app using Firebase, but when I run the code, 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
My grade file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.example.sebastian.chatapp"
minSdkVersion 16
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'
}
}
}
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.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.google.firebase:firebase-core:9.8.0'
compile 'com.google.firebase:firebase-invites:9.8.0'
compile 'com.firebaseui:firebase-ui:0.6.0'
compile 'com.google.firebase:firebase-auth:10.0.0'
compile 'com.android.support:support-v4:25.1.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
How can i resolve this issue?
I had the same issue!, this a non-sense type problem & solution.
move your
apply plugin: 'com.google.gms.google-services' to the top of the file.
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
......
Hey code contains duplicate dependency.
compile'com.android.support:appcompat-v7:25.1.0'
compile'com.google.firebase:firebase-core:10.0.1'
compile'com.android.support:design:23.4.0'
compile'com.google.firebase:firebase-core:9.8.0'
compile'com.google.firebase:firebase-invites:9.8.0'
compile'com.firebaseui:firebase-ui:0.6.0'
compile'com.google.firebase:firebase-auth:10.0.0'
compile'com.android.support:appcompat-v7:25.1.0' //remove this
compile'com.android.support:design:25.1.0' //remove this
compile'com.android.support:support-v4:23.0.1' //remove this
testCompile'junit:junit:4.12'
Hope this help.Happy coding.
Firebase UI has transitive dependencies on the Firebase SDK libraries. The compatible versions are listed in a table in the Firebase UI documentation. To use the latest (10.0.1) version of the Firebase SDK, you must use version 1.0.1 of the Firebase UI library. You should also use consistent versions of the Firebase SDK libraries and Support libraries. Update your dependencies like this:
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-invites:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.firebaseui:firebase-ui:1.0.1'
testCompile 'junit:junit:4.12'
Also, to use firebase-ui:1.0.1 the following change must be made to your project (top-level) build.gradle file:
allprojects {
repositories {
jcenter()
mavenLocal()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
}