今天在Android Studio 4.2.2直接允许main方法报如下错误
Initialization script 'C:\Users\Administrator\AppData\Local\Temp\FactoryTest_main__.gradle' line: 21
* What went wrong:
A problem occurred configuring project ':app'.
> Could not create task ':app:FactoryTest.main()'.
> SourceSet with name 'main' not found.
在.idea下面的gradle.xml 加上
<option name="delegatedBuild" value="false" />
然后重新允许就可以了

本文介绍了解决在Android Studio中运行FactoryTest.main()方法时遇到的配置错误问题。通过在.idea文件夹下的gradle.xml文件中添加一行代码<option name=delegatedBuild value=false/>,可以成功解决找不到'main'源集的问题。
2023

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



