今天拉下来的代码,编译时报错:
Error:The module ‘app’ is an Android project without build variants, and cannot be built. Please fix the module’s configuration in the build.gradle file and sync the project again.
解决方法:(我用的第一个方法,2、3为网络上找到的方法)
1.SDK Manager -> 安装app支持的SDK版本:我的问题是这台电脑上并没有安装所有的SDK,安装对应SDK时会让你去accept licenses,所以只要安装SDK platform到app相关的版本即可
2.File -> Invalidate Caches / Restart:使缓存无效并重新启动
3.修改gradle版本:可能你的build.gradle并没有问题,而是gradle版本与你现在的不同导致