方法一:
Cannot locate factory for objects of type DefaultGradleConnector, as ConnectorServiceRegistry has been closed.
解决办法:原因是gradle里面的文件被修改了,此时会在studio编辑界面出现 asyn gradle点击同步即可
原文地址:http://blog.csdn.net/shanjianxiliulc/article/details/44308907
有时候,上面的方法也不好使
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
把上面的1.1.0改改,可以改成0.6.+,然后再编译、同步什么的,都点点。
如果还不行,把上面的还原,关掉Android Studio重新打开,可能就好了。