The app you're developing is integrated with the Facebook Ad Jar Audiencenetwork.jar and intends to update to its latest version of 4.14.1.
Delete the old Audiencenetwork.jar in the local Lib library and add it in the app's Build.gradle dependencies
Compile (' com.facebook.android:audience-network-sdk:4.14.1 ')
Compile error message as follows:
Failure:build failed with an exception.
* What went wrong:
Execution failed for task ': Transformclasseswithjarmergingfordebug '.
> Com.android.build.api.transform.TransformException:java.util.zip.ZipException:duplicate entry:com/google/ Android/gms/internal/zzaa.class
* Try:
Run with--STACKTRACE option to get the stack trace. Run with--info or--debug option to get more log output.
BUILD FAILED
From duplicate entry to see is that there are duplicate classes are packaged resulting excepion, consult gradle documents, can exclude duplicate file packaging, the next issue is to troubleshoot which file is the problem, from the above information to see, It should be from a class under Com.google.android.gms, considering that this problem has not happened before using the Facebook jar to be packaged separately, then it should be the result of compiling dependent 4.14.1.
To rely on the warehouse Jcenter home Jfrog Bintray, search for Facebook, find the corresponding file audience-network-sdk:4.14.1, there are 2 of the AAR and pom suffix files, we only look at the configuration file, as follows:
<?xml version= "1.0" encoding= "UTF-8"?>
<project xsi:schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" Xmlns= "http://maven.apache.org/POM/4.0.0"
xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" >
<modelVersion>4.0.0</modelVersion>
<groupId>com.facebook.android</groupId>
<artifactId>audience-network-sdk</artifactId>
<version>4.14.1</version>
<packaging>aar</packaging>
<name>Audience-Network-SDK</name>
<description>facebook audience Network SDK for android</description>
<url>https://developers.facebook.com/products/app-monetization/audience-network/</url>
<licenses>
<license>
<name>facebook Platform license</name>
<url>https://github.com/facebook/facebook-android-sdk/blob/master/LICENSE.txt</url>
<distribution>repo</distribution>
</license>
<license>
<name>apache License Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>facebook</id>
<name>Facebook</name>
</developer>
</developers>
<scm>
<url>https://developers.facebook.com/docs/android/downloads</url>
</scm>
<dependencies>
<dependency>
<groupId>com.google.android.gms</groupId>
<artifactId>play-services-ads</artifactId>
<version>8.4.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>23.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>recyclerview-v7</artifactId>
<version>23.1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Obviously, the error is generated when packaging play-services-ads, because the need to integrate firebase, in Build.gradle added
Apply plugin: ' Com.google.gms.google-services '
The result is that the entire family of Google services has been added, and there will naturally be advertising services, resulting in conflicts.
Find the reason is very good to solve, in the compilation of the repetition of the removal can be.
Part of the original Build.gradle dependency:
dependencies {
compile fileTree(: , : [])
compile compile compile compile compile
}
apply :
After the update:
dependencies {
compile fileTree(: , : [])
compile compile compile compile compile () {
exclude : exclude : exclude : }
}
apply :
Compile again, success!
This article from "Blue Work Study Notes" blog, please be sure to keep this source http://pisota.blog.51cto.com/3109961/1835669
How to resolve issues with integrated Firebase and Facebook AD package conflicts