更新到4.10版后Android Gradle同步失败

更新到4.10版后Android Gradle同步失败,android,gradle,Android,Gradle,将AndroidStudio、Gradle和com.android.tools.build:Gradle更新到新版本后,我收到以下错误: org/jetbrains/kotlin/kapt/idea/KaptGradleModelorg/jetbrains/kotlin/kapt/idea/KaptGradleModel gradle.properties: buildscript { ext.kotlin_version = '1.3.21' repositories {

将AndroidStudio、Gradle和
com.android.tools.build:Gradle
更新到新版本后,我收到以下错误:

org/jetbrains/kotlin/kapt/idea/KaptGradleModelorg/jetbrains/kotlin/kapt/idea/KaptGradleModel
gradle.properties:

buildscript {
    ext.kotlin_version = '1.3.21'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
        classpath 'com.novoda:bintray-release:0.9'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}


ext {
    VERSION = version()
}

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


task version {
    println version()
}

def String version() {
    def versionPropsFile = file('version.properties')
    def Properties versionProps = new Properties()
    versionProps.load(new FileInputStream(versionPropsFile))

    return versionProps['major'] + "." + versionProps['minor'] + "." + versionProps['patch']
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.jakewharton.hugo'
apply plugin: 'com.novoda.bintray-release'

android {
    compileSdkVersion 28

    defaultConfig {
        applicationId "xxx.xxxxxxx.xxxxxxxxxxxx"
        minSdkVersion 21
        versionCode 1
        versionName "1"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled = true
    }

    dataBinding {
        enabled = true
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/rxjava.properties'
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
项目梯度:

buildscript {
    ext.kotlin_version = '1.3.21'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
        classpath 'com.novoda:bintray-release:0.9'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}


ext {
    VERSION = version()
}

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


task version {
    println version()
}

def String version() {
    def versionPropsFile = file('version.properties')
    def Properties versionProps = new Properties()
    versionProps.load(new FileInputStream(versionPropsFile))

    return versionProps['major'] + "." + versionProps['minor'] + "." + versionProps['patch']
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.jakewharton.hugo'
apply plugin: 'com.novoda.bintray-release'

android {
    compileSdkVersion 28

    defaultConfig {
        applicationId "xxx.xxxxxxx.xxxxxxxxxxxx"
        minSdkVersion 21
        versionCode 1
        versionName "1"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled = true
    }

    dataBinding {
        enabled = true
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/rxjava.properties'
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
然后是应用程序梯度:

buildscript {
    ext.kotlin_version = '1.3.21'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
        classpath 'com.novoda:bintray-release:0.9'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}


ext {
    VERSION = version()
}

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


task version {
    println version()
}

def String version() {
    def versionPropsFile = file('version.properties')
    def Properties versionProps = new Properties()
    versionProps.load(new FileInputStream(versionPropsFile))

    return versionProps['major'] + "." + versionProps['minor'] + "." + versionProps['patch']
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.jakewharton.hugo'
apply plugin: 'com.novoda.bintray-release'

android {
    compileSdkVersion 28

    defaultConfig {
        applicationId "xxx.xxxxxxx.xxxxxxxxxxxx"
        minSdkVersion 21
        versionCode 1
        versionName "1"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled = true
    }

    dataBinding {
        enabled = true
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/rxjava.properties'
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

升级你的Kotlin插件

简单的方法(推荐)

Double shift->Plugins->Updates->search Kotlin->Update!->重新启动为

手动方式(如果需要)

1) 从该链接手动下载Kotlin插件

2) 双击shift->Plugins->(设置)图标->从磁盘安装->选择该插件


3) 重新启动Android Studio。

升级Kotlin插件

简单的方法(推荐)

Double shift->Plugins->Updates->search Kotlin->Update!->重新启动为

手动方式(如果需要)

1) 从该链接手动下载Kotlin插件

2) 双击shift->Plugins->(设置)图标->从磁盘安装->选择该插件


3) 重新启动Android Studio。

请提供错误日志。@FaysalAhmed应用程序无法运行,我在构建过程中只能得到这样的结果:
org/jetbrains/kotlin/kapt/idea/KaptGradleModelorg/jetbrains/kotlin/kapt/idea/KaptGradleModel
请尝试删除kotlin插件并再次同步好吗?您好@DolDurma,您解决了这个问题吗?我也面临同样的问题:(@ppreetikaa这是你的,请提供错误日志。@FaysalAhmed应用程序无法运行,我在构建过程中只能得到这样的结果:
org/jetbrains/kotlin/kapt/idea/KaptGradleModelorg/jetbrains/kotlin/kapt/idea/KaptGradleModel
你能尝试删除kotlin插件并再次同步吗?你好@DolDurma,你解决了吗?我也是面对同样的问题:(@ppreetikaa这是你的