`
dengzhangtao
  • 浏览: 667102 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

AndroidStudio无法执行Java的main函数

阅读更多
FAILURE: Build failed with an exception.

* Where:
Initialization script 'C:\Users\lp\AppData\Local\Temp\ThreadDemo_main__.gradle' line: 21

* What went wrong:
A problem occurred configuring project ':app'.
> Could not create task ':app:ThreadDemo.main()'.
   > SourceSet with name 'main' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
解决方案:
项目目录下找.idea文件目录下gradle.xml文件
打开文件查找是否有delegatedBuild节点,如果没有就加上,如果有检查value是否为false
<option name="delegatedBuild" value="false" />
注意是在GradleProjectSettings标签下
改完之后保存重新build项目运行就可以了


原文链接:https://blog.csdn.net/lplj717/article/details/108366752
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics