/ / Kotlin crash Impossible de convertir la notation fournie en un objet de type Dépendance: org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension_Decorated - android, gradle, kotlin

Kotlin crash Impossible de convertir la notation fournie en objet de type Dependency: org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension_Decorated - android, gradle, kotlin

Après avoir passé la version de kotlin de 1.0.5-2 à 1.1.0, j'ai un crash:

Error:(114, 0) Cannot convert the provided notation to an object of type Dependency: org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension_Decorated@5a39a165.
The following types/formats are supported:
- Instances of Dependency.
- String or CharSequence values, for example "org.gradle:gradle-core:1.0".
- Maps, for example [group: "org.gradle", name: "gradle-core", version: "1.0"].
- FileCollections, for example files("some.jar", "someOther.jar").
- Projects, for example project(":some:project:path").
- ClassPathNotation, for example gradleApi().

Comprehensive documentation on dependency notations is available in DSL reference for DependencyHandler type.

Le projet n'est pas synchronisé, je ne peux donc pas appeler de dépendances de niveaux ni quoi que ce soit d'autre.

construction principale

ext {
kotlin_version = "1.1.0"
//(...)
kotlin = "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

Sync se bloque dans l'application build.gradle

dependencies {
compile kotlin
//...
}

Réponses:

2 pour la réponse № 1

Il s'avère que le mot clé "kotlin" est utilisé dansgradle la configuration de la nouvelle version de kotlin dependecy. La solution consistait à modifier le libellé de dépendance de kotlin en (par exemple) kotlinDependency

Vieux:

ext {
kotlin_version = "1.1.0"
//(...)
kotlin = "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

Nouveau:

ext {
kotlin_version = "1.1.0"
//(...)
kotlinDependency = "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}