找不到main方法

2020-05-24  本文已影响0人  wintersweett

问题描述:

Could not create task ':app:wo.main()'.
SourceSet with name 'main' not found.

解决:
方案一:run with coverage
方案二:在.idea下面的gradle.xml文件中 插入“ delegatedBuild” 这个属性配置,整体如下
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="false" />
<option name="testRunner" value="PLATFORM" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="PROJECT_DIR" />
<option name="modules">
<set>
<option value="PROJECT_DIR" />
<option value="PROJECT_DIR/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

上一篇下一篇

猜你喜欢

热点阅读