Error:Execution failed for task ':transformClassesWithJarMergingForRelease' - android

I am implementing facebook native ads in unity that needs gradle build from unity. After importing to Android Studio and gradle sync it runs well but during signed APK it produces the error which is.
Error:Execution failed for task ':transformClassesWithJarMergingForRelease'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/unity3d/ads/android/BuildConfig.class

This error means you have duplicate class definition for:
com.unity3d.ads.android.BuildConfig
Try look into your jar/aar to see if the class is present at multiple places.
I like to use grep (linux/osx) or 7-Zip to quickly explores my jar/aar files

Related

Manifest merger failed and duplicate files when trying to build my unity project on android studio

I am trying to build my project on android studio but I get this errors:
Execution failed for task ':launcher:mergeDebugJavaResource'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
More than one file was found with OS independent path 'META-INF/facebook-core_release.kotlin_module'.
java.lang.RuntimeException: Manifest merger failed
Manifest merger failed
Duplicate class found
I also get a lot of erros on my AndroidManifest.xml that look like this one.
Class referenced in the manifest, com.facebook.unity.FBUnityDialogsActivity, was not found in the project or the libraries
Unresolved class 'FBUnityDialogsActivity'
I have tried all the solutions I could find on the internet and I also tried the suggestions android studio makes but none of them worked. The project is made with unity and I am just using android stuidio build the APK. Also some of the errors only occur after I implement Facebook SDK into my project.

Error when I add webview_flutter : Execution failed for task ':app:transformClassesWithMultidexlistForDebug'

I am getting the following Error When I run the flutter project only after installed webview_flutter plugin.
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'
> com.android.build.api.transform.TransformException: Error while generating the main dex list.
I am already using firebase in the app. some searches saying this is the problem related to the firebase. Searches are giving following solutions. I have tried all of them. but still getting the same.
Migrating to Android X, Making multiDexEnabled true in android build.gradle,

A library is internally compiling another version of a library that I need externally?

There's a library that I need to integrate in my project:
adobeMobileLibrary-4.14.0.jar
But when I try to run it gives me this error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/adobe/mobile/AbstractDatabaseBacking$CorruptedDatabaseException.class
So I found that a compiled .aar library is internally compiling the same adobeMobileLibrary but in another version.
What would be the best way to solve this type of problem?

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.

Braintree - Error Setting Up Advanced Fraud Tools On Android

We're already setup with Braintree, I'm having issues setting up our Android project with Braintree's Advanced Fraud Tools. We’ve followed all of the instructions here
I'm getting the following error message when we run the app after the library is imported through Gradle.
Error:Execution failed for task ':App:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: com/devicecollector/AbstractCollectorProcess.class

Categories

Resources