【androidstudio】The SourceSet ‘instrumentTest‘ is not recognized by the Android Gradle Plugin

问题描述

The SourceSet ‘instrumentTest’ is not recognized by the Android Gradle Plugin. Perhaps you misspelled something?

AndroidStudio升级到4.0.1后编译报错:The SourceSet ‘instrumentTest’ is not recognized by the Android Gradle Plugin. 是因为
【androidstudio】The SourceSet ‘instrumentTest‘ is not recognized by the Android Gradle Plugin
这里的配置中 instrumentTest 已被弃用,不适用于现在的 gradle 版本

解决办法

用 androidTest 替换 instrumentTest,编译运行即可。