由于Android studio在编译的时候会联网,所以当你在编译的时候,如果遇到这种情况,可以试试以下方法 连接网络以后再编译,如果还不行: File->Settings->Build,Execution,Deployment->Gradle 勾选offline work即可