Error in compiling ui dependency in android studio - 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/zzahl.class

In terminal execute in root project folder:
./gradlew clean
Try this!

The documentation says that.
Each version of FirebaseUI has dependency on a fixed version of these
libraries, defined as the variable firebase_version in
common/constants.gradle. If you are using any dependencies in your app
of the form compile 'com.google.firebase:firebase-:x.y.z' or compile
'com.google.android.gms:play-services-:x.y.z' you need to make sure
that you use the same version that your chosen version of FirebaseUI
requires.

Related

Error when i run app from android studio

Error:Execution failed for task
':app:transformClassesWithJarMergingForDebug'. >
com.android.build.api.transform.TransformException:
java.util.zip.ZipException: duplicate entry:
android/support/v7/appcompat/R$anim.class
It appears you are including the appCompat v7 library more then once. You may need to do a replace in your manifest page to avoid this issue.
For example you can override the gms version like this
You may need to do the equivelent for appcompat or find out which libraries are including it. Consider setting their transitives = false to avoid pulling it in muliple times.
Also view your dependency tree to see where/what dependencies are being overwritten at compile time.
This could also be a propagated error because of duplicated JAR files in your libs directory that are also in your Gradle dependency section.
But basically you have a duplicated dependency.

How to solve the conflict dependency of Rx Java version 1 and 2 in Android

I have only used RxJava2,but Why conflict occurred with RxJava1.1.5
I am getting below exception:
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/rxjava.properties
File1: /home/panhao/Android/myGradle/caches/modules-2/files-2.1/io.reactivex.rxjava2/rxjava/2.0.0-RC5/ecd92d1147d9858c23087801a3bc2f323d481472/rxjava-2.0.0-RC5.jar
File2: /home/panhao/Android/myGradle/caches/modules-2/files-2.1/io.reactivex/rxjava/1.1.5/ece7b5d0870e66d8226dab6dcf47a2b12afff061/rxjava-1.1.5.jar
Issue occurs due to two main reason as mentioned below.
Your might forgot to remove older version dependency from gradle or libs for the Rxjava
Or your project might contain some library module which might have dependency to the older or newer version of same library used by you in your project.
you need to add resolution strategy as mentioned below in your
projects build.gradle file. this will force your project to use
mentioned version of library
android{
.......
configurations.all {
resolutionStrategy {
force 'io.reactivex.rxjava2:rxandroid:2.0.1'
}
}
}

app:transformClassesWithJarMergingForDebug apk build issue

When I try to build apk android studio gives me this error.
Can anyone has any idea about this error?
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: permissions/dispatcher/GrantableRequest.class
If you are using PermissionsDispatcher library thn its mentioned as issue for duplicate class entry.
How to Check attached libraries Dependency/hierarchy ? which causes duplicate entry for libraries.
In your case you need to make changes as per mentioned in libraries known issue.
compile 'com.github.hotchemi:permissionsdispatcher:2.0.3'
compile 'com.github.hotchemi:permissionsdispatcher-processor:2.0.3'
Make changes as per below
compile 'com.github.hotchemi:permissionsdispatcher:2.0.3'
apt 'com.github.hotchemi:permissionsdispatcher-processor:2.0.3'
For more details on duplicate entry issue please check this
UPDATE
Its required to define apt dependecies in root level build.gradle file also
check this for root level build.gradle file declaration.
Let me know if anything

TransformException after updating gradle version

Am using the following library Autobahn for web sockets usage in my Android project.
When am using the old gradle version 1.3.0, am not encountering any issues in building & running the app, whereas
when i update the gradle version to 1.5.0, am encountering the following issue.
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: de/tavendo/autobahn/ByteBufferInputStream.class
I have tried the below options already
1. multiDexEnabled is set to true in gradle file.
2. gradlew clean is also done, along with clean build.
Any other suggestions to resolve this issue would be great.
Regards,
Dinesh Kumar G
Here is a interesting way to add Autoban build to gradle. Try to remove your jar and add this in your build file.

Duplicate Dependency Error At Run Time

I added Parceler Dependency, in build.gradle.
dependencies {
// Parceler
compile 'org.parceler:parceler-api:1.0.4'
apt 'org.parceler:parceler:1.0.4'
}
When i build the project, the project builds successfully but at run time it's throwing the below error.
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/parceler/Parceler$$Parcels$1.class
I tried ./gradlew clean command, i did invalidate and restart cache. I also update my android studio to 12.1 preview and gradle to 2.10, but still the same issue.
Any kind of help or suggestions would be appreciated.
It sounds like a duplication of classes between a library (or libraries) and the main project:
http://parceler.org/#avoiding_parcels_indexing
After going through the parceler.org doc, i solved this issue by setting parcelsIndex = false to each of the model classes.
Parceler will not write a Parceler$$Parcels mapping class if no indexable classes exist and the Parcels utiltiy class will fallback to looking up the generated class by name.

Categories

Resources