Android tests build error: Multiple dex files define Landroid/support/test/BuildConfig

前端 未结 7 2334
逝去的感伤
逝去的感伤 2020-12-01 05:02

I\'m trying to add Espresso 2 to my project (which also has lots of other dependencies), but I\'m hitting this error when trying to run tests:

UNEXPECTED TOP         


        
7条回答
  •  旧巷少年郎
    2020-12-01 05:28

    My solution:

    compile 'com.android.support:appcompat-v7:22.1.0'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1'
    androidTestCompile 'com.android.support:support-annotations:22.1.0'
    androidTestCompile 'com.android.support.test:runner:0.2'
    

    +

    android {
        packagingOptions {
            exclude 'LICENSE.txt'
       }
    }
    

提交回复
热议问题