Fixed
Status Update
Comments
[Deleted User] <[Deleted User]> #2
This is a terrible oversight on our part but unfortunately there is no clean way to revert this API in order to break Guava dependency.
As a result, there will be a breaking public API change in the next release to address this issue. We introduced an ugly wrapper around Guava Optional class, named EspressoOptional which will live under "android.support.test.espresso.util" namespace. Developers that were using the leaked Guava Optional API will need to change their imports and references to use EspressoOptional during the update to the new version.
Sorry for the inconvenience this may cause. We'll make sure to add a note for this in the next release announcement and change-logs.
As a result, there will be a breaking public API change in the next release to address this issue. We introduced an ugly wrapper around Guava Optional class, named EspressoOptional which will live under "android.support.test.espresso.util" namespace. Developers that were using the leaked Guava Optional API will need to change their imports and references to use EspressoOptional during the update to the new version.
Sorry for the inconvenience this may cause. We'll make sure to add a note for this in the next release announcement and change-logs.
mo...@gmail.com <mo...@gmail.com> #3
One of the workarounds for this issue is excluding above files from packaging. Simply edit build.gradle file and add
packagingOptions {
exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
}
packagingOptions {
exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
}
sl...@google.com <sl...@google.com>
sl...@google.com <sl...@google.com> #4
This issue has been fixed, and will ship in the next release.
s....@gmail.com <s....@gmail.com> #5
still persist in Android studio version 1.3.2
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:1.5.0-beta2'
}
Error shows up when i use guava and roboguice dependencies.
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:1.5.0-beta2'
}
Error shows up when i use guava and roboguice dependencies.
cw...@xmlhq.com <cw...@xmlhq.com> #6
I am seeing this issue as well. It showed up with the Android studio 2.0 update.
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/maven/com.google.guava/guava/pom.properties
File1: /Users/cwitte/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/18.0/cce0823396aa693798f8882e64213b1772032b09/guava-18.0.jar
File2: /Users/cwitte/.gradle/caches/modules-2/files-2.1/org.roboguice/roboguice/3.0.1/24e814f35d5cc28eaa7e9f07a50ea69deeb2b544/roboguice-3.0.1.jar
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/maven/com.google.guava/guava/pom.properties
File1: /Users/cwitte/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/18.0/cce0823396aa693798f8882e64213b1772032b09/guava-18.0.jar
File2: /Users/cwitte/.gradle/caches/modules-2/files-2.1/org.roboguice/roboguice/3.0.1/24e814f35d5cc28eaa7e9f07a50ea69deeb2b544/roboguice-3.0.1.jar
nk...@google.com <nk...@google.com> #7
What version of Espresso are you using?
Make sure to use Espresso 2.2.2, Runner/Rules 0.5
Make sure to use Espresso 2.2.2, Runner/Rules 0.5
mi...@gmail.com <mi...@gmail.com> #8
I am also seeing same issue. Is there a workaround?
mi...@gmail.com <mi...@gmail.com> #9
I am using Espresso 2.2.2, Runner/Rules 0.5 and android studio 1.5.1.
nk...@google.com <nk...@google.com>
pk...@gmail.com <pk...@gmail.com> #10
Yes same here... observing this issue post Android studio 2.0 update! Please let us know a fix or workaround.
kl...@gmail.com <kl...@gmail.com> #11
The solution is to use this in build.gradle:
android {
packagingOptions {
exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
}
}
ref:https://code.google.com/p/android/issues/detail?id=194980
android {
packagingOptions {
exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
}
}
ref:
io...@google.com <io...@google.com> #12
Still having this issue with Espresso 2.2.2 and Android Studio 2.2 Preview 1.
[Deleted User] <[Deleted User]> #13
I'm getting the following exception:
Execution failed for task ':app:transformClassesWithJarMergingForInternalDebugAndroidTest'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/thirdparty/publicsuffix/PublicSuffixPatterns.class
Even with packaginOptions set to exclude pom files
Execution failed for task ':app:transformClassesWithJarMergingForInternalDebugAndroidTest'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/thirdparty/publicsuffix/PublicSuffixPatterns.class
Even with packaginOptions set to exclude pom files
[Deleted User] <[Deleted User]> #14
^ Espresso 2.2.2, Rules/Runner 0.5, AS 2.1.3
pa...@gmail.com <pa...@gmail.com> #15
The release notes for 2.2.2 https://google.github.io/android-testing-support-library/downloads/release-notes/ say this is fixed, but I can still reproduce it, even without guava on the dependency list:
Execution failed for task ':transformResourcesWithMergeJavaResForDebugAndroidTest'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException:
Duplicate files copied in APK META-INF/maven/com.google.guava/guava/pom.xml
File1: I:\build\intermediates\exploded-aar\com.android.support.test.espresso\espresso-web\2.2.2\jars\classes.jar
File2: I:\build\intermediates\exploded-aar\com.android.support.test.espresso\espresso-core\2.2.2\jars\classes.jar
Execution failed for task ':transformResourcesWithMergeJavaResForDebugAndroidTest'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException:
Duplicate files copied in APK META-INF/maven/com.google.guava/guava/pom.xml
File1: I:\build\intermediates\exploded-aar\com.android.support.test.espresso\espresso-web\2.2.2\jars\classes.jar
File2: I:\build\intermediates\exploded-aar\com.android.support.test.espresso\espresso-core\2.2.2\jars\classes.jar
ag...@gmail.com <ag...@gmail.com> #16
I'm also running into same problem where conflicting guava dependencies have been found
Resolved versions for app (18.0) and test app (16.0.1) differ.
Resolved versions for app (18.0) and test app (16.0.1) differ.
br...@gmail.com <br...@gmail.com> #17
A workaround is to use the no-dependency version. I found it hosted here:
https://android.googlesource.com/platform/prebuilts/misc/+/master/common/android-support-test/espresso/espresso-web-2.2.2-release-no-dep.jar
And can be included with:
androidTestCompile files('libs/espresso-web-2.2.2-release-no-dep.jar')
And can be included with:
androidTestCompile files('libs/espresso-web-2.2.2-release-no-dep.jar')
nk...@google.com <nk...@google.com>
sl...@google.com <sl...@google.com> #18
Fixed in the next Espresso release 3.0.0. All Runner/Espresso artifacts, that jarjar guava, don't embed Guava's pom files anymore.
Description
If you use Guava in your tools, this leads to a conflict:
Execution failed for task ':app:transformResourcesWithMergeJavaResForDevDebugAndroidTest'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.google.guava/guava/pom.properties
File1: /Users/me/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/18.0/cce0823396aa693798f8882e64213b1772032b09/guava-18.0.jar
File2: /Users/me/Documents/android_workspace/MyApp/app/build/intermediates/exploded-aar/com.android.support.test.espresso/espresso-core/2.2/jars/classes.jar