问题可能是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 等等错误时也相同,缺少什么添加什么,
这样就能解决问题了。