原文错误提示:

Error:(16, 0) Gradle DSL method not found: 'Android()'
Possible causes:<ul><li>The project ‘XXXXXXX' may be using a version of Gradle that does not contain the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>

 

错误原因:

android studio 引进项目时,自动查找本机是否有项目设置的SDK版本,若发现没有,我们会在project structure修改成自己的SDK。然而,修改后,AS会自动在项目下的build.gradle里添加上以下代码:

android studio报错提示: Gradle DSL method not found: 'android() 解决方案

 

解决办法:

删除以上图片中红框中的代码,然后再执行build->Rebuild project,删除完之后的代码如下:

android studio报错提示: Gradle DSL method not found: 'android() 解决方案

 
 

相关文章:

  • 2022-12-23
  • 2022-01-16
  • 2021-07-22
  • 2021-03-31
  • 2021-07-19
  • 2021-11-30
  • 2021-10-22
  • 2021-06-04
猜你喜欢
  • 2021-05-13
  • 2022-12-23
  • 2022-01-30
  • 2021-11-13
  • 2022-12-23
相关资源
相似解决方案