[android] IMA library includes POM files

543 views
Skip to first unread message

Brian Chu

unread,
Dec 2, 2015, 4:31:52 AM12/2/15
to Interactive Media Ads SDK
I got this error when compile the project in the (beta) Android Studio 2.0:

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/brian.chu/work/android/ws/flagship_phone/app/libs/ima-android-v3-3.b13.3.jar File2: /Users/brian.chu/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/18.0/cce0823396aa693798f8882e64213b1772032b09/guava-18.0.jar

and it traces back to the ima jar which include the POM files.

I manually remove pom.* files (all files under maven folder) and it works.

Could you update your maven to not include those files?

thanks!


Tyler Sidell (IMA SDK Team)

unread,
Dec 2, 2015, 4:27:52 PM12/2/15
to Interactive Media Ads SDK
Hi Brian,

Thank you for voicing your concerns.  I will speak with the rest of the team about updating maven.  For clarification, are you only experiencing these error messages in Android Studio 2.0 or have you seen them in other versions as well?

Thanks,
Tyler Sidell
IMA SDK Team

Brian Chu

unread,
Dec 2, 2015, 7:41:06 PM12/2/15
to Interactive Media Ads SDK
Only Android Studio 2.0 (in beta right now)

Adrian Rodriguez

unread,
Dec 7, 2015, 7:52:08 AM12/7/15
to Interactive Media Ads SDK
Experiencing the same issue with another library. Android Studio 1.5

* What went wrong:
Execution failed for task ':app:transformResourcesWithMergeJavaResForMobileDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/org.apache.commons/commons-lang3/pom.properties
  File1: /t/app/libs/ima-android-v3-3.b13.3.jar
  File2: /t/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.3.2/90a3822c38ec8c996e84c16a3477ef632cbc87a3/commons-lang3-3.3.2.jar

Shawn Busolits (IMA SDK Team)

unread,
Dec 7, 2015, 4:43:58 PM12/7/15
to Interactive Media Ads SDK
Hi all,

For the issues that you're seeing, are you adding these colliding libs manually (guava or apache commons lang) or are they being pulled in automatically as a dependency of something else? I'm able to compile our advanced sample fine with Android Studio 2.0, so I'm trying to determine what's different about your projects that would be causing this error.

Thanks,
Shawn Busolits
IMA SDK Team

Adrian Rodriguez

unread,
Dec 16, 2015, 7:30:20 AM12/16/15
to Interactive Media Ads SDK
We have them as dependencies:

    compile 'commons-io:commons-io:2.4'
    compile 'org.apache.commons:commons-lang3:3.3.2'

Shawn Busolits (IMA SDK Team)

unread,
Dec 21, 2015, 11:19:23 AM12/21/15
to Interactive Media Ads SDK
Hi Adrian,

Thanks for the info. Are you able to replicate this with our sample app? I have my build.gradle set up as follows and I'm not seeing the issue:

apply plugin: 'com.android.application'

android {
    compileSdkVersion
21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId
"com.google.ads.interactivemedia.v3.samples.videoplayerapp"
        minSdkVersion 9
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes
{
        release
{
            minifyEnabled
false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
   
}

    packagingOptions
{
        exclude
'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE.txt'
    }
}

dependencies
{
    compile fileTree
(dir: 'libs', include: ['*.jar'])
    compile
'com.android.support:appcompat-v7:21.+'
    compile 'com.google.android.gms:play-services-ads:8.3.0'
    compile 'commons-io:commons-io:2.4'
    compile 'org.apache.commons:commons-lang3:3.3.2'
}

Thanks,
Shawn Busolits
IMA SDK Team

Reply all
Reply to author
Forward
0 new messages