The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Android Studio 编译时,报错
解决方案:
1. 升级到你对应的gradle工具,我的是
classpath "com.android.tools.build:gradle:4.1.1"
2. 重新编译
参考:
https://stackoverflow.com/questions/26354153/android-studio-gradle-error-at-compile-time
https://developer.android.com/studio/releases/gradle-plugin#revisions