androidtv-sample-inputs: DuplicateRelativeFileException: More than one file was found with OS independent path

When trying to build my project with the dependency:

com.google.android.libraries.tv:companionlibrary:0.2

I get the following error:

Error:com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path ‘third_party/java_src/error_prone/project/annotations/Annotations.gwt.xml’

I looks like this file is inside the com.google.ads.interactivemedia.v3:interactivemedia library that the companionlibrary depends on.

I tried to exclude it:

implementation('com.google.android.libraries.tv:companionlibrary:0.2') {
        exclude group: 'com.google.android.gms', module: 'play-services-ads'
        exclude group: 'com.google.ads.interactivemedia.v3', module: 'interactivemedia'
    }

But then it fails in onCreateSession with: java.lang.Class<com.google.android.media.tv.companionlibrary.AdController>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/ads/interactivemedia/v3/api/AdErrorEvent$AdErrorListener;

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 1
  • Comments: 15 (3 by maintainers)

Most upvoted comments

This is how I currently have the project included in a build.gradle:

// TV Input Framework
implementation('com.google.android.libraries.tv:companionlibrary:0.2') {
    exclude group: "com.google.ads.interactivemedia.v3"
    exclude group: "com.google.android.gms"
    exclude group: "com.android.support"
}

I do have more modernization on the way.

Hi, Only put the code in my gradle:

packagingOptions { exclude 'error_prone/Annotations.gwt.xml' exclude 'third_party/java_src/error_prone/project/annotations/Annotations.gwt.xml' exclude 'third_party/java_src/error_prone/project/annotations/Google_internal.gwt.xml' exclude 'jsr305_annotations/Jsr305_annotations.gwt.xml' }

Anyone use this and got it working ? There seems to be a problem with this Repository.

Also @integer/google_play_services_version file is missing

For Update :

packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/rxjava.properties'

        exclude 'error_prone/Annotations.gwt.xml'

        exclude 'third_party/java_src/error_prone/project/annotations/Annotations.gwt.xml'
        exclude 'third_party/java_src/error_prone/project/annotations/Google_internal.gwt.xml'
        exclude 'third_party/java_src/error_prone/project/annotations/Google_internal.gwt.xml'
        exclude 'jsr305_annotations/Jsr305_annotations.gwt.xml'
    }