Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable

       出现错误的原因是:

          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
        }
         接下来编译通过。


猜你喜欢

转载自blog.csdn.net/qq_28670711/article/details/77649955