錯(cuò)誤提示:
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.
錯(cuò)誤原因:
android studio 引進(jìn)項(xiàng)目時(shí)滥沫,自動(dòng)查找本機(jī)是否有項(xiàng)目設(shè)置的SDK版本,若發(fā)現(xiàn)沒有,我們會(huì)在project structure修改成自己的SDK仁期。然而眼五,修改后案腺,AS會(huì)自動(dòng)在項(xiàng)目下的build.gradle里添加上以下代碼:
解決辦法:
刪除以上圖片中紅框中的代碼日戈,然后再執(zhí)行build->Rebuild project战坤,刪除完之后的代碼