出现错误的原因是:
gradle的版本过低导致的
解决办法:
将build.gradle文件里的
classpath 'com.android.tools.build:gradle:1.3.0' 修改为
classpath 'com.android.tools.build:gradle:2.2.3'
如果再次编译时遇到:
Error:No service of type Factory<LoggingManagerInternal> available in Project
即是因为maven的版本过低导致。将build.gradle修改如下:
dependencies { classpath 'com.android.tools.build:gradle:2.2.3' classpath'com.github.dcendents:android-maven-gradle-plugin:1.4.1' classpath'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.3.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }接下来编译通过。