AndroidStudio升级后,项目存在的问题

之前用的是AndroidStudio2.2.1之后升级到AndroidStudio3.0.1版本
遇到如下问题:
1,Declaring custom ‘clean’ task when using

Error:(48, 1) A problem occurred evaluating root project 'NEWAPP'.
> Declaring custom 'clean' task when using the standard Gradle lifecycle plugins is not allowed.

解决方法:
来自:http://blog.csdn.net/poorkick/article/details/72599929
把build.gradle中的clean task 无情地注释掉。

//task clean(type: Delete) {
//   delete rootProject.buildDir
//}

2,No service of type Factory

Error:No service of type Factory<LoggingManagerInternal> available in ProjectScopeServices.

clean项目。出现问题3
3,Could not create plugin of type ‘AndroidMavenPlugin’.

Warning:The specified Android SDK Build Tools version (24.0.2) is ignored, as it is below the minimum supported version (26.0.2) for Android Gradle Plugin 3.0.1.
Android SDK Build Tools 26.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '24.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Information:BUILD FAILED in 2s
Error:FAILURE: Build failed with an exception.

* Where:
Script 'https://raw.githubusercontent.com/Commit451/gradle-android-javadocs/1.0.0/gradle-android-javadocs.gradle' line: 17

* What went wrong:
A problem occurred evaluating script.
> Failed to apply plugin [id 'com.github.dcendents.android-maven']
   > Could not create plugin of type 'AndroidMavenPlugin'.
      > No service of type Factory available in ProjectScopeServices.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s

解决办法:
来自:http://blog.csdn.net/suwenlai/article/details/55046644

dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath group: 'com.zeroc.gradle.ice-builder', name: 'slice', version: '1.3.14'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4'
    }

之前classpath ‘com.github.dcendents:android-maven-gradle-plugin:1.4’是1.3版本,换成1.4
4,换buildToolsVersion “26.0.2”

build.gradle里的buildToolsVersion在gradle3.0.1中对应的是26.0.2
buildToolsVersion "26.0.2"

你可能感兴趣的:(Android基础)