DuplicateFileException m4b + game services 9.0

Error: execution completed for task ': app: transformResourcesWithMergeJavaResFor'.

com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: duplicate files copied to the APK jsr305_annotations / Jsr305_annotations.gwt.xml File1: \ application \ assembly \ intermediate \ parsed-AAR \ Google- SDK-map-m4b \ jars \ classes.jar File2: \ application \ assembly \ intermediate \ parsed-AAR \ com.google.android.gms \ play-basement service \ 9.0.0 \ jar \ classes.jar

+8
android google-play-services
source share
2 answers

Add the text below to build.gradle in the android{} section to solve the problem.

 android { ... packagingOptions { exclude 'jsr305_annotations/Jsr305_annotations.gwt.xml' exclude 'build-data.properties' } ... } 

If you get more errors, a DuplicateFileException adds an exception file. For example:

Mistake

 Duplicate files copied in APK jsr305_annotations/Jsr305_annotations.gwt.xml 

Decision

 exclude 'jsr305_annotations/Jsr305_annotations.gwt.xml' 
+14
source share

Adding this file to your gradle file will solve your problem:

 packagingOptions { exclude 'jsr305_annotations/Jsr305_annotations.gwt.xml' } 
+4
source share

All Articles