Output directory not specified for Module

Error:Kotlin:Output directory not specified for Module ‘XXX’ production

第一步

点击左上角File打开Project Structure…
Output directory not specified for Module

第二步

找到Modules 点击项目,然后点减号进行删除
Output directory not specified for Module

删除后点确定

Output directory not specified for Module

先不要慌,确定过后感觉文件不在了,其实还在,此时打开pom.xml

Output directory not specified for Module

第四步

打开pom文件后,右击,找到菜单中 Add as Maven Project点击,等待项目加载完成,便不会再报些错误了
Output directory not specified for Module