Error when i run app from android studio - android

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.

Related

Error in compiling ui dependency in android studio

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.

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

How to remove a jar file from the external libraries directory, which is added by the gradle dependency, in android?

First, I have added a dependency in gradle, and then sync the project. We have no error, but when we run the application, we got an error which is also showing in the image.
:app:transformClassesWithJarMergingForDebug FAILED
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: javax/inject/Inject.class
We found a duplicate jar file with different version which is highlighted above. Now I want to remove only this duplicate jar file(java.inject-1).
Hope someone has a solution for this.
please try below in your gradle dependency.
compile('org.igniterealtime:rest-api-client:1.1.3')
{exclude module: "javax.inject"}
You can close Android Studio, delete all the .idea folders and .iml files in your project and re-import.
If you are using Android Studio Use Refactor. Just
Right Click the .jar file choose "Refactor > safe delete"
.

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