問題可能是compliesdk版本和項目版本不一致造成的,只需要在項目根目錄build.gradle配置文件中加入 如下配置(全局配置):
此外,出現 Cannot get property 'buildToolsVersion' on extra properties extension as it does not exist 或者
Cannot get property 'appCompatVersion' on extra properties extension as it does not exist 等等錯誤時也相同,缺少什麼添加什麼,
這樣就能解決問題了。