Status Update
Comments
om...@gmail.com <om...@gmail.com> #2
Any news?
ca...@massimocarli.it <ca...@massimocarli.it> #3
Same problem here.
Gradle: Execution failed for task ':Probe:packageTest'.
> Duplicate files copied in APK about.html
File 1: /Users/xxxxx/.gradle/caches/artifacts-26/filestore/org.eclipse.jetty/jetty-server/9.0.3.v20130506/jar/20ac6a58af5bb2d3287376fcf2f548c218e8c7e9/jetty-server-9.0.3.v20130506.jar
File 2: /Users/xxxxx/.gradle/caches/artifacts-26/filestore/org.eclipse.jetty/jetty-server/9.0.3.v20130506/jar/20ac6a58af5bb2d3287376fcf2f548c218e8c7e9/jetty-server-9.0.3.v20130506.jar
Any update?
Gradle: Execution failed for task ':Probe:packageTest'.
> Duplicate files copied in APK about.html
File 1: /Users/xxxxx/.gradle/caches/artifacts-26/filestore/org.eclipse.jetty/jetty-server/9.0.3.v20130506/jar/20ac6a58af5bb2d3287376fcf2f548c218e8c7e9/jetty-server-9.0.3.v20130506.jar
File 2: /Users/xxxxx/.gradle/caches/artifacts-26/filestore/org.eclipse.jetty/jetty-server/9.0.3.v20130506/jar/20ac6a58af5bb2d3287376fcf2f548c218e8c7e9/jetty-server-9.0.3.v20130506.jar
Any update?
ca...@massimocarli.it <ca...@massimocarli.it> #4
Well,
in the past I had found a solution that consists in executing this command on every duplicated jars
zip -d jetty-continuation-8.1.6.v20120903.jar about.html
The problem is into the about.html file which is present in all the jars. So we have to enter the .gradle caches directory and execute that command.
Is there any more elegant, and correct, solution for that? I mean, a param into gradle that tells to ignore duplicate files?
Thanks
in the past I had found a solution that consists in executing this command on every duplicated jars
zip -d jetty-continuation-8.1.6.v20120903.jar about.html
The problem is into the about.html file which is present in all the jars. So we have to enter the .gradle caches directory and execute that command.
Is there any more elegant, and correct, solution for that? I mean, a param into gradle that tells to ignore duplicate files?
Thanks
om...@gmail.com <om...@gmail.com> #5
Maven android plugin provide option: extractDuplicates to fix this issue:
https://code.google.com/p/maven-android-plugin/issues/detail?id=123
But no same stuff in gradle plugin.
But no same stuff in gradle plugin.
xa...@android.com <xa...@android.com>
or...@gmail.com <or...@gmail.com> #7
The gradle plugin's com.android.builder.internal.packaging.Packager class calls into com.android.ide.common.packaging.PackagingUtils.checkFileForPackaging().
That checkFileForPackaging() method compares the filename against a list of well-known unwanted files, including "overview.html" and "package.html". Adding "about.html" to this list seems like a reasonable and straightforward fix, for now.
Ideally, an affordance for the user to inject a custom filter (the Zip filter in Packager is finalized and also private) from the build recipe would be even better.
That checkFileForPackaging() method compares the filename against a list of well-known unwanted files, including "overview.html" and "package.html". Adding "about.html" to this list seems like a reasonable and straightforward fix, for now.
Ideally, an affordance for the user to inject a custom filter (the Zip filter in Packager is finalized and also private) from the build recipe would be even better.
or...@gmail.com <or...@gmail.com> #8
Here's an xargs incantation to make the workaround a little bit easier in the meantime (tested with the BSD versions of find and xargs, not GNU):
cd .gradle/caches
find . -name \*jetty\*.jar -print0 | xargs -0 -t -n 1 -J POOP zip -d POOP about.html
cd .gradle/caches
find . -name \*jetty\*.jar -print0 | xargs -0 -t -n 1 -J POOP zip -d POOP about.html
xa...@android.com <xa...@android.com> #9
Gradle 1.7 added the ability to customize duplicate file handling. We want to do the same thing.
For now though, excluding about.html sounds like a good, quick workaround. We'll do this.
FYI gradle does this:http://www.gradle.org/docs/1.7/release-notes#duplicate-file-handling-for-copy-and-archive-operations
For now though, excluding about.html sounds like a good, quick workaround. We'll do this.
FYI gradle does this:
xa...@android.com <xa...@android.com> #10
0.7.0 will filter out about.html.
an...@andyandy.info <an...@andyandy.info> #12
[Comment deleted]
ja...@gmail.com <ja...@gmail.com> #13
Same problem with META-INF/LICENSE, in these two libs together:
dependencies {
compile 'com.fasterxml.jackson.core:jackson-databind:2.2.3'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.3'
}
dependencies {
compile 'com.fasterxml.jackson.core:jackson-databind:2.2.3'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.3'
}
xa...@android.com <xa...@android.com> #14
yeah, now that we stopped filtering out all META-INF/ file we have a lot more case of this conflicts.
I'm going to fix this tomorrow and push an update.
I'm going to fix this tomorrow and push an update.
jo...@gmail.com <jo...@gmail.com> #15
I have this:
> Duplicate files copied in APK META-INF/LICENSE.txt
File 1: /Users/admin/android/xyz/xyz-android-reloaded/lib/httpclient-4.2.5.jar
File 2: /Users/admin/android/xyz/xyz-android-reloaded/lib/httpclient-4.2.5.jar
> Duplicate files copied in APK META-INF/LICENSE.txt
File 1: /Users/admin/android/xyz/xyz-android-reloaded/lib/httpclient-4.2.5.jar
File 2: /Users/admin/android/xyz/xyz-android-reloaded/lib/httpclient-4.2.5.jar
ho...@gmail.com <ho...@gmail.com> #16
I have this
Duplicate files copied in APK META-INF/LICENSE
File 1: /Users/admin/.gradle/caches/modules-2/files-2.1/com.google.inject/guice/3.0/28586dc97c525501329d9a242fc3402041e3572d/guice-3.0-no_aop.jar
File 2: /Users/admin/.gradle/caches/modules-2/files-2.1/com.google.inject/guice/3.0/28586dc97c525501329d9a242fc3402041e3572d/guice-3.0-no_aop.jar
Duplicate files copied in APK META-INF/LICENSE
File 1: /Users/admin/.gradle/caches/modules-2/files-2.1/com.google.inject/guice/3.0/28586dc97c525501329d9a242fc3402041e3572d/guice-3.0-no_aop.jar
File 2: /Users/admin/.gradle/caches/modules-2/files-2.1/com.google.inject/guice/3.0/28586dc97c525501329d9a242fc3402041e3572d/guice-3.0-no_aop.jar
[Deleted User] <[Deleted User]> #17
Is there a temporary fix for this until we can get our hands on 0.7.1?
jo...@gmail.com <jo...@gmail.com> #18
I have issue 36903763 . Cant build my APK, could someone kind explain a bit more how I can make it work?
da...@gmail.com <da...@gmail.com> #19
Quick and dirty work around (remove the files from the cached .jar archives which cause the conflicts):
For my installation the following patterns have been sufficient:
find ~/.gradle/caches/ -iname "*.jar" -exec zip -d '{}' 'META-INF/NOTICE*' \;
find ~/.gradle/caches/ -iname "*.jar" -exec zip -d '{}' 'META-INF/LICENSE*' \;
When the next gradle plugin is released you can delete the subfolders of ~/.gradle/caches in order to make Gradle load fresh ones.
For my installation the following patterns have been sufficient:
find ~/.gradle/caches/ -iname "*.jar" -exec zip -d '{}' 'META-INF/NOTICE*' \;
find ~/.gradle/caches/ -iname "*.jar" -exec zip -d '{}' 'META-INF/LICENSE*' \;
When the next gradle plugin is released you can delete the subfolders of ~/.gradle/caches in order to make Gradle load fresh ones.
da...@gmail.com <da...@gmail.com> #20
[Comment deleted]
jo...@gmail.com <jo...@gmail.com> #21
I finally went into libs of my Android project an issued:
find . -iname "httpclient-4.2.5.jar" -exec zip -d '{}' 'META-INF/*' \;
find . -iname "httpclient-4.2.5.jar" -exec zip -d '{}' 'META-INF/*' \;
je...@jnagels.be <je...@jnagels.be> #22
It's also in META-INFO/DEPENDENCIES*...
com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/DEPENDENCIES
File 1: /Users/jelle/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpmime/4.3.1/f7899276dddd01d8a42ecfe27e7031fcf9824422/httpmime-4.3.1.jar
File 2: /Users/jelle/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpmime/4.3.1/f7899276dddd01d8a42ecfe27e7031fcf9824422/httpmime-4.3.1.jar
com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/DEPENDENCIES
File 1: /Users/jelle/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpmime/4.3.1/f7899276dddd01d8a42ecfe27e7031fcf9824422/httpmime-4.3.1.jar
File 2: /Users/jelle/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpmime/4.3.1/f7899276dddd01d8a42ecfe27e7031fcf9824422/httpmime-4.3.1.jar
kn...@gmail.com <kn...@gmail.com> #23
Depending on the jar files in the cache there are all sorts of duplicates in the META-INF directory, and case variations in e.g. notice.txt not NOTICE.
A quick fix would very much be appreciated.
A quick fix would very much be appreciated.
xa...@android.com <xa...@android.com>
xa...@android.com <xa...@android.com> #24
0.7.1 is out with the fix for this.
The DSL to exclude files is:
android {
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
}
You can add as many exclude statement as you want. The value is the archive path. No wildcard or glob support yet.
The DSL to exclude files is:
android {
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
}
You can add as many exclude statement as you want. The value is the archive path. No wildcard or glob support yet.
[Deleted User] <[Deleted User]> #25
Thanks for the quick fix Xav! You guys are really rocking the releases. The new lint stuff is great.
xa...@android.com <xa...@android.com> #26
Note that it's only for app project.
However I just realized that if you have a test app for a library, then you might run into the same issue. We'll add to 0.7.2 the ability to apply the packagingOptions to library projects.
However I just realized that if you have a test app for a library, then you might run into the same issue. We'll add to 0.7.2 the ability to apply the packagingOptions to library projects.
oh...@gmail.com <oh...@gmail.com> #27
problem with dagger compiler
Duplicate files copied in APK META-INF/services/javax.annotation.processing.Processor File 1: C:\Users\Mantas.gradle\caches\modules-2\files-2.1\com.squareup.dagger\dagger-compiler\1.2.0\22633bb84433e03d345a83e7b0c08c66768be30\dagger-compiler-1.2.0.jar File 2: C:\Users\Mantas.gradle\caches\modules-2\files-2.1\com.squareup.dagger\dagger-compiler\1.2.0\22633bb84433e03d345a83e7b0c08c66768be30\dagger-compiler-1.2.0.jar
Duplicate files copied in APK META-INF/services/javax.annotation.processing.Processor File 1: C:\Users\Mantas.gradle\caches\modules-2\files-2.1\com.squareup.dagger\dagger-compiler\1.2.0\22633bb84433e03d345a83e7b0c08c66768be30\dagger-compiler-1.2.0.jar File 2: C:\Users\Mantas.gradle\caches\modules-2\files-2.1\com.squareup.dagger\dagger-compiler\1.2.0\22633bb84433e03d345a83e7b0c08c66768be30\dagger-compiler-1.2.0.jar
xp...@gmail.com <xp...@gmail.com> #29
Still the same problem:
Execution failed for task ':foodex-android:packageDebug'.
> Duplicate files copied in APK META-INF/DEPENDENCIES
File 1: /home/user/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.3/11393498b38e9695d0850cac26fde5613ae268b9/httpcore-4.3.jar
File 2: /home/user/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.3/11393498b38e9695d0850cac26fde5613ae268b9/httpcore-4.3.jar
package has volley (https://android.googlesource.com/platform/frameworks/volley ) and facebook (https://github.com/facebook/facebook-android-sdk.git ) in dependencies.
Also Android unit Tests are included into this project.
Execution failed for task ':foodex-android:packageDebug'.
> Duplicate files copied in APK META-INF/DEPENDENCIES
File 1: /home/user/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.3/11393498b38e9695d0850cac26fde5613ae268b9/httpcore-4.3.jar
File 2: /home/user/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.3/11393498b38e9695d0850cac26fde5613ae268b9/httpcore-4.3.jar
package has volley (
Also Android unit Tests are included into this project.
an...@moldedbits.com <an...@moldedbits.com> #30
What is the expected date for the 0.7.2 release? I am working on a library project that depends on the httpmime library.
ba...@gmail.com <ba...@gmail.com> #31
[Comment deleted]
ba...@gmail.com <ba...@gmail.com> #32
the same happens in
OS Ubuntu 13.10
JRE 1.7
AS 0.4.2
gradle plugin 0.7.3
gradle 1.9
> Duplicate files copied in APK META-INF/LICENSE
File 1: /home/bazted/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.2.3/1a0113da2cab5f4c216b4e5e7c1dbfaa67087e14/jackson-core-2.2.3.jar
File 2: /home/bazted/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.2.3/1a0113da2cab5f4c216b4e5e7c1dbfaa67087e14/jackson-core-2.2.3.jar
OS Ubuntu 13.10
JRE 1.7
AS 0.4.2
gradle plugin 0.7.3
gradle 1.9
> Duplicate files copied in APK META-INF/LICENSE
File 1: /home/bazted/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.2.3/1a0113da2cab5f4c216b4e5e7c1dbfaa67087e14/jackson-core-2.2.3.jar
File 2: /home/bazted/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.2.3/1a0113da2cab5f4c216b4e5e7c1dbfaa67087e14/jackson-core-2.2.3.jar
xa...@android.com <xa...@android.com> #33
Please see comment 26 about how to fix this. You need to manually exclude the duplicate file from the packaging.
g....@gmail.com <g....@gmail.com> #34
I'have the same issue using android tools 0.8.+ (it should be 0.8.3). I have also the problem that I can't exclude the file because there is the declaration of the MessageBodyReader of jersey (without it jeresey doesn't works). Here the error:
* What went wrong:
Execution failed for task ':FlyWithFriends:packageDebug'.
> Duplicate files copied in APK META-INF/services/javax.ws.rs.ext.MessageBodyReader
File 1: /Users/gcastaldi/.gradle/caches/modules-2/files-2.1/com.sun.jersey/jersey-json/1.18/76204239e551ae47dbbf871a5649660661a053a0/jersey-json-1.18.jar
File 2: /Users/gcastaldi/.gradle/caches/modules-2/files-2.1/com.sun.jersey/jersey-json/1.18/76204239e551ae47dbbf871a5649660661a053a0/jersey-json-1.18.jar
And here my build.gradle:
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.1'
}
}
apply plugin: 'android'
apply plugin: 'android-apt'
def AndroidAnnotationsVersion = '3.0.1'
android {
compileSdkVersion 19
buildToolsVersion '19.0.1'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java']
resources.srcDirs = ['src/main/resources']
res.srcDirs = ['src/main/res']
assets.srcDirs = ['src/main/assets']
}
instrumentTest {
java.srcDirs = ['src/instrumentTest/java']
}
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/jersey-module-version'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
// exclude 'META-INF/services/javax.ws.rs.ext.MessageBodyReader'
// exclude 'META-INF/services/javax.ws.rs.ext.MessageBodyWriter'
}
}
dependencies {
compile 'com.android.support:gridlayout-v7:19.0.1'
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:support-v4:19.0.0'
apt "org.androidannotations:androidannotations:$AndroidAnnotationsVersion"
compile "org.androidannotations:androidannotations-api:$AndroidAnnotationsVersion"
compile project(':zFlightsLibs:flights')
compile project(':zFlightsLibs:flightsBravofly')
compile fileTree(dir: 'libs', include: ['*.jar'])
instrumentTestCompile 'org.assertj:assertj-core:1.5.0'
}
apt {
arguments {
androidManifestFile variant.processResources.manifestFile
resourcePackageName 'ch.exmachina.flywithfriends'
}
}
* What went wrong:
Execution failed for task ':FlyWithFriends:packageDebug'.
> Duplicate files copied in APK META-INF/services/javax.ws.rs.ext.MessageBodyReader
File 1: /Users/gcastaldi/.gradle/caches/modules-2/files-2.1/com.sun.jersey/jersey-json/1.18/76204239e551ae47dbbf871a5649660661a053a0/jersey-json-1.18.jar
File 2: /Users/gcastaldi/.gradle/caches/modules-2/files-2.1/com.sun.jersey/jersey-json/1.18/76204239e551ae47dbbf871a5649660661a053a0/jersey-json-1.18.jar
And here my build.gradle:
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.1'
}
}
apply plugin: 'android'
apply plugin: 'android-apt'
def AndroidAnnotationsVersion = '3.0.1'
android {
compileSdkVersion 19
buildToolsVersion '19.0.1'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java']
resources.srcDirs = ['src/main/resources']
res.srcDirs = ['src/main/res']
assets.srcDirs = ['src/main/assets']
}
instrumentTest {
java.srcDirs = ['src/instrumentTest/java']
}
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/jersey-module-version'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
// exclude 'META-INF/services/javax.ws.rs.ext.MessageBodyReader'
// exclude 'META-INF/services/javax.ws.rs.ext.MessageBodyWriter'
}
}
dependencies {
compile 'com.android.support:gridlayout-v7:19.0.1'
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:support-v4:19.0.0'
apt "org.androidannotations:androidannotations:$AndroidAnnotationsVersion"
compile "org.androidannotations:androidannotations-api:$AndroidAnnotationsVersion"
compile project(':zFlightsLibs:flights')
compile project(':zFlightsLibs:flightsBravofly')
compile fileTree(dir: 'libs', include: ['*.jar'])
instrumentTestCompile 'org.assertj:assertj-core:1.5.0'
}
apt {
arguments {
androidManifestFile variant.processResources.manifestFile
resourcePackageName 'ch.exmachina.flywithfriends'
}
}
xa...@android.com <xa...@android.com> #35
I'm reopening this to track issues where you really want a version of the file. I started working on a fix.
xa...@android.com <xa...@android.com> #36
Since 0.9.1 you can do the following:
android.packagingOptions {
pickFirst 'META-INF/services/javax.ws.rs.ext.MessageBodyReader'
}
Note that this will literally pick the first one. There's no way to choose. we intend to add more options in the future. I've filed Issue 36949180 to track this.
android.packagingOptions {
pickFirst 'META-INF/services/javax.ws.rs.ext.MessageBodyReader'
}
Note that this will literally pick the first one. There's no way to choose. we intend to add more options in the future. I've filed
um...@gmail.com <um...@gmail.com> #37
I have an error
Error:Execution failed for task ':sSD:packageDebug'.
> Duplicate files copied in APK META-INF/LICENSE
File 1: C:\Android\androidWorkspace\mtd\sSD\libs\jackson-all-1.9.11.jar
File 2: C:\Android\androidWorkspace\mtd\sSD\libs\jackson-all-1.9.11.jar
I don't understand which file should I edit.
The stack over flow said The DSL to exclude files is:
android {
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
}
But I don't know which file to put that command.
What is DSL?
https://stackoverflow.com/questions/20673625/android-gradle-plugin-0-7-0-duplicate-files-during-packaging-of-apk
Error:Execution failed for task ':sSD:packageDebug'.
> Duplicate files copied in APK META-INF/LICENSE
File 1: C:\Android\androidWorkspace\mtd\sSD\libs\jackson-all-1.9.11.jar
File 2: C:\Android\androidWorkspace\mtd\sSD\libs\jackson-all-1.9.11.jar
I don't understand which file should I edit.
The stack over flow said The DSL to exclude files is:
android {
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
}
But I don't know which file to put that command.
What is DSL?
to...@googlemail.com <to...@googlemail.com> #38
xa...@android.com <xa...@android.com> #39
put this in your build.gradle for the module where the error is.
ro...@gmail.com <ro...@gmail.com> #40
Does the packagingOptions DSL still work? I am noticing that even in spite of generating APK's with the packagingOptions { exclude 'AndroidManifest.xml' }, the file is still being included and these errors are showing up on multi-project builds.
Part of me is suspicious that these DSL statements no longer apply in the new Gradles...at least in 0.10+ and above.
Part of me is suspicious that these DSL statements no longer apply in the new Gradles...at least in 0.10+ and above.
se...@gmail.com <se...@gmail.com> #41
I'm having the same problems as discribed in #43 with the packagingOptions. Is there any other solution to get around this?
ro...@gmail.com <ro...@gmail.com> #42
Turns out not to be an issue for me. I solved the problem by verifying that the android plugin is only declared once in build.gradle (apply plugin: 'android'). Your other libraries need to be declared as android-library (apply plugin: 'android-library'). If you have two it's likely there will be conflicts.
am...@gmail.com <am...@gmail.com> #43
Same problem with #43, I've double checked the new library that I've imported which causes the problem, and it has android-library declared properly. So #45's solution doesn't seem to be the right solution at all or a very specific environment solution.
ba...@gmail.com <ba...@gmail.com> #44
"exclude" and "pickFirst" on lib/armeabi/lib123.so are no effect.
ma...@gmail.com <ma...@gmail.com> #45
I am still having this issue, nearly 2 years later. here is my build.gradle.
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.running.mattboyle.runnertoolbox"
minSdkVersion 21
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
packagingOptions {
pickFirst 'META-INF/LICENSE.txt'
}
}
dependencies {
compile 'com.android.support:support-v4:21.0.3'
compile 'com.google.android.gms:play-services:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.running.mattboyle.runnertoolbox"
minSdkVersion 21
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
packagingOptions {
pickFirst 'META-INF/LICENSE.txt'
}
}
dependencies {
compile 'com.android.support:support-v4:21.0.3'
compile 'com.google.android.gms:play-services:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
m....@gmail.com <m....@gmail.com> #46
I think this might be a bug related to predexing. We ran into multiple
issues with both this error and duplicate class definitions until we turned
off predexing altogether (our Maven build worked just fine with the same
dependency setup)
Can you turn it off and see if the problem persists?
issues with both this error and duplicate class definitions until we turned
off predexing altogether (our Maven build worked just fine with the same
dependency setup)
Can you turn it off and see if the problem persists?
st...@gmail.com <st...@gmail.com> #47
Got the same error in Android Studio v1.1.0
Adding
packagingOptions {
exclude 'META-INF/license.txt'
exclude 'META-INF/notice.txt'
}
To gradle file fixed it.
Adding
packagingOptions {
exclude 'META-INF/license.txt'
exclude 'META-INF/notice.txt'
}
To gradle file fixed it.
ff...@gmail.com <ff...@gmail.com> #49
Happened today: Android Studio 1.2.1.1 under Ubuntu Linux 14.04 LTS. Same fix as #51.
mo...@gmail.com <mo...@gmail.com> #50
PackagingOptions exclude stopped functioning in 2.1.3
ga...@gmail.com <ga...@gmail.com> #51
[Comment deleted]
pc...@gmail.com <pc...@gmail.com> #52
Same issue: Using Gradle 2.2.2
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/jersey-module-version
File1: /Users/stuff/.gradle/caches/modules-2/files-2.1/com.sun.jersey/jersey-client/1.13/ec38c57a78940bf5f8f5971307ca89406849647/jersey-client-1.13.jar
File2: /Users/stuff/.gradle/caches/modules-2/files-2.1/com.sun.jersey/jersey-core/1.13/4326a56dc6b2d67b7313905c353e1af225bb164f/jersey-core-1.13.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/jersey-module-version
File1: /Users/stuff/.gradle/caches/modules-2/files-2.1/com.sun.jersey/jersey-client/1.13/ec38c57a78940bf5f8f5971307ca89406849647/jersey-client-1.13.jar
File2: /Users/stuff/.gradle/caches/modules-2/files-2.1/com.sun.jersey/jersey-core/1.13/4326a56dc6b2d67b7313905c353e1af225bb164f/jersey-core-1.13.jar
ar...@gmail.com <ar...@gmail.com> #53
Host OS: windows 7
When I add dependency: jetty, then i cant build android project with gradle.
Error:Execution failed for task ':app:packageDebug'.
> Duplicate files copied in APK META-INF/LICENSE
File 1: C:\Users\ARJUN\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.2.2\d20be6a5ddd6f8cfd36ebf6dea329873a1c41f1b\jackson-core-2.2.2.jar
File 2: C:\Users\ARJUN\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\2.2.2\285cb9c666f0f0f3dd8a1be04e1f457eb7b15113\jackson-annotations-2.2.2.jar
When I add dependency: jetty, then i cant build android project with gradle.
Error:Execution failed for task ':app:packageDebug'.
> Duplicate files copied in APK META-INF/LICENSE
File 1: C:\Users\ARJUN\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.2.2\d20be6a5ddd6f8cfd36ebf6dea329873a1c41f1b\jackson-core-2.2.2.jar
File 2: C:\Users\ARJUN\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\2.2.2\285cb9c666f0f0f3dd8a1be04e1f457eb7b15113\jackson-annotations-2.2.2.jar
Description
SDK tools: Gradle 0.6.3
When I add dependency: jetty, then i cant build android project with gradle.
Each jetty jar contains about.html file. When apk packaging, it pack this about.html files and got error:
rror: duplicate files during packaging of APK .../basic/build/apk/basic-debug-unaligned.apk
Path in archive: about.html
Origin 1: ...filestore/org.eclipse.jetty/jetty-servlet/8.1.8.v20121106/jar/285ea47746e9ab988a8291ea9fd6545b537e0ce9/jetty-servlet-8.1.8.v20121106.jar
Origin 2: ...filestore/org.eclipse.jetty/jetty-client/8.1.8.v20121106/jar/f194a5a07ada9dab48e226c4e8152d120ce1e76f/jetty-client-8.1.8.v20121106.jar
STEPS TO REPRODUCE:
1. Download and unpack error-test project
2. run ./gradlew build
3. Error occured
EXPECTED RESULTS:
Build without duplicate exception
Attached very simple gradle project with jetty and no way to build it. Very sadly. This is critical.