google-cloud-java: Dependency conflict when adding google-cloud-translate to Android app.
This is essentially a dupe of issue #1319 but with Google Translate.
I added the Google Translate Java client library to my Android app per these instructions, which consists of adding this line to my build.gradle file of my library project (which is a dependency of my app project):
compile group: 'com.google.cloud', name: 'google-cloud-translate', version: '0.4.0'
However when I build, I get this error:
Error:Execution failed for task ':typeSmart:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
File1: C:\Users\Barry\.gradle\caches\modules-2\files-2.1\com.google.auto.value\auto-value\1.1\f6951c141ea3e89c0f8b01da16834880a1ebf162\auto-value-1.1.jar
File2: C:\Users\Barry\.gradle\caches\modules-2\files-2.1\org.codehaus.jackson\jackson-core-asl\1.9.11\e32303ef8bd18a5c9272780d49b81c95e05ddf43\jackson-core-asl-1.9.11.jar
File3: C:\Users\Barry\.gradle\caches\modules-2\files-2.1\com.google.inject\guice\4.0\f990a43d3725781b6db7cd0acf0a8b62dfd1649\guice-4.0.jar
I tried all the suggestions in the other issue but I’m happy to go over them again.
I’m using the latest version of Android Studio (2.2.2) with the Gradle wrapper.
Any help is much appreciated. Thanks in advance!
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 22 (6 by maintainers)
Commits related to this issue
- chore: update github actions (#1361) (#729) * chore: update github actions * chore: update Source-Link: https://github.com/googleapis/synthtool/commit/1622741e6877d4b335b137ac7e07f7f32d4e5af7 Post-P... — committed to suztomo/google-cloud-java by gcf-owl-bot[bot] 2 years ago
- chore: update github actions (#1361) (#745) * chore: update github actions * chore: update Source-Link: https://github.com/googleapis/synthtool/commit/1622741e6877d4b335b137ac7e07f7f32d4e5af7 Post-P... — committed to googleapis/google-cloud-java by gcf-owl-bot[bot] 2 years ago
- chore: update github actions (#1361) (#298) * chore: update github actions * chore: update Source-Link: https://github.com/googleapis/synthtool/commit/1622741e6877d4b335b137ac7e07f7f32d4e5af7 Post-P... — committed to googleapis/google-cloud-java by gcf-owl-bot[bot] 2 years ago
- chore: update github actions (#1361) (#618) * chore: update github actions * chore: update Source-Link: https://github.com/googleapis/synthtool/commit/1622741e6877d4b335b137ac7e07f7f32d4e5af7 Po... — committed to googleapis/google-cloud-java by gcf-owl-bot[bot] 2 years ago
@BarryFruitman the relevant bits from the example are the following (see the example’s build.gradle to see where to put them):
If this is in place you should not have problems running your app. Please double check and do a clean build.