Android Studio 执行java.main报错:
解决:
修改项目文件 ..\.idea\gradle.xml
,GradleProjectSettings
标签下新增一行 <option name="delegatedBuild" value="false" />
,即不通过gradle委托来build。
完整的 ..\.idea\gradle.xml
如下:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<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="gradleHome" value="/Applications/study/gradle/gradle-6.2.2" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>