Сбой Android Gradle Sync после обновления до версии 4.10 - PullRequest
0 голосов
/ 18 февраля 2019

После обновления AndroidStudio, Gradle и com.android.tools.build:gradle до новой версии я получаю эту ошибку:

org/jetbrains/kotlin/kapt/idea/KaptGradleModelorg/jetbrains/kotlin/kapt/idea/KaptGradleModel

gradle.properties:

#Mon Feb 18 21:35:48 IRST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

Проект Gradle:

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']
}

, а затем приложение Gradle:

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'
        }
    }
}

1 Ответ

0 голосов
/ 22 апреля 2019

Обновите свой плагин Kotlin.

Простой способ (рекомендуется).

Double shift -> Plugins -> Updates -> search Kotlin -> Update! -> Restart AS

Вручную (если вам нужно).

1) Загрузите плагин Kotlin вручную по этой ссылке.

2) Двойная смена -> Плагины -> Значок (Настройки) -> Установить с диска -> Выберите этот плагин.

3) Перезапустите AndroidСтудия.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...