Gradle DSL method not found: 'android()
16lz
2021-12-04
原文错误提示:
Error:(16, 0) Gradle DSL method not found: 'android()'
Possible causes:
- The project ‘XXXXXXX' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file - The build file may be missing a Gradle plugin.
Apply Gradle plugin - Android拍照、录像、录音代码范例
- android的listView中设置line
- Android(安卓)代码实现关机重启
- android上tcpdump 抓包
- Android--自定义SeekBarPreference控件
- Android项目:proguard混淆第三方jar.
- compileSdkVersion、buildToolsVersion、targetSdkVersion 、Fai
- Android自动化测试
- android Dialog弹在底部核心代码
错误原因:
android studio 引进项目时,自动查找本机是否有项目设置的SDK版本,若发现没有,我们会在project structure修改成自己的SDK。然而,修改后,AS会自动在项目下的build.gradle里添加上以下代码:
解决办法:
删除以上图片中红框中的代码,然后再执行build->Rebuild project,删除完之后的代码如下: