问题描述
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. 是因为

这里的配置中 instrumentTest 已被弃用,不适用于现在的 gradle 版本。
解决办法
用 androidTest 替换 instrumentTest,编译运行即可。
本文解决了AndroidStudio升级至4.0.1版本后出现的编译错误问题,具体错误为:TheSourceSet‘instrumentTest’isnotrecognizedbytheAndroidGradlePlugin。文中指出该问题是由于instrumentTest配置被弃用导致,提供了解决方案:使用androidTest替换instrumentTest。
2002

被折叠的 条评论
为什么被折叠?



