在Android Studio 3.2.1中,Instant Run与Jacoco 0.8.2存在冲突,导致无法正常使用。解决该问题的方法是禁用Instant Run或降级Jacoco版本。
方法一:禁用Instant Run
方法二:降级Jacoco版本
androidTestImplementation 'org.jacoco:org.jacoco.agent:0.8.2:runtime'
androidTestImplementation 'org.jacoco:org.jacoco.agent:0.8.1:runtime'
请注意,这两种方法只需选择其中一种即可解决问题。禁用Instant Run可能会影响到开发过程中的代码热替换功能,而降级Jacoco版本可能会影响代码覆盖率统计的准确性。因此,您需要根据自己的需求选择适合的解决方案。