More than one file was found with an OS-independent path prototeuf.meta,

I see some compatibility issues between com.google.android.gms:play-services-auth:11.6.0and com.android.support.test.espresso:espresso-core:3.0.1 when used as dependencies on the android library module

I get this error:

Execution failed for task ':mylibrary:transformResourcesWithMergeJavaResForDebugAndroidTest'.   
More than one file was found with OS independent path 'protobuf.meta'

when i try to execute ./gradlew :myLibrary:connectedAndroidTest

Here are the build.gradle bubbles that I reproduced the problem:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 26



    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.google.android.gms:play-services-auth:11.6.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

I don’t think I can exclude any of these files as the contents are different.

+4
source share
1 answer

- , , . , , . build.gradle(Module: app).

:

android {
    // [...]
    packagingOptions {
        pickFirst 'protobuf.meta'
    }
}

: exclude 'protobuf.meta'

Android, - , , build.gradle.

+12

Source: https://habr.com/ru/post/1689287/


All Articles