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

前端 未结 7 2344
逝去的感伤
逝去的感伤 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:10

    I recently ran into this error after we enabled incremental gradle builds.

    dexOptions {
        javaMaxHeapSize "2g"
        incremental true
    }
    

    This was resolved by disabling predexing libraries.

    dexOptions {
        javaMaxHeapSize "2g"
        incremental true
        preDexLibraries = false
    }
    

提交回复
热议问题