Я пытаюсь импортировать kotlin в мои подмодули:
уровень проекта
...
buildscript {
ext.kotlin_version = '1.3.21'
repositories {
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
...
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
...
уровень модуля
apply plugin: 'kotlin-android'
...
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
...
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
И после того, как я попытался синхронизировать, я получил эту ошибку:
ERROR: Unable to resolve dependency for ':app@develop/compileClasspath': Could not resolve project :libraries:Foundation.
Show Details
Affected Modules: app
И трассировка стека:
Caused by: java.lang.NullPointerException
at com.google.common.collect.UsingToStringOrdering.compare(UsingToStringOrdering.java:33)
at org.gradle.api.internal.attributes.DefaultDisambiguationRuleChain$ExceptionHandler.handleException(DefaultDisambiguationRuleChain.java:99)
at org.gradle.api.internal.attributes.DefaultDisambiguationRuleChain$ExceptionHandler.handleException(DefaultDisambiguationRuleChain.java:87)
at org.gradle.internal.action.InstantiatingAction.execute(InstantiatingAction.java:44)
at org.gradle.api.internal.attributes.DefaultDisambiguationRuleChain.execute(DefaultDisambiguationRuleChain.java:75)
at org.gradle.api.internal.attributes.DefaultDisambiguationRuleChain.execute(DefaultDisambiguationRuleChain.java:38)
at org.gradle.api.internal.attributes.DefaultAttributesSchema$MergedSchema.disambiguate(DefaultAttributesSchema.java:183)
at org.gradle.internal.component.model.MultipleCandidateMatcher.disambiguateWithAttribute(MultipleCandidateMatcher.java:215)
at org.gradle.internal.component.model.MultipleCandidateMatcher.disambiguateWithRequestedAttributes(MultipleCandidateMatcher.java:202)
at org.gradle.internal.component.model.MultipleCandidateMatcher.disambiguateCompatibleCandidates(MultipleCandidateMatcher.java:192)
at org.gradle.internal.component.model.MultipleCandidateMatcher.getMatches(MultipleCandidateMatcher.java:111)
at org.gradle.internal.component.model.ComponentAttributeMatcher.match(ComponentAttributeMatcher.java:123)
at org.gradle.api.internal.attributes.DefaultAttributesSchema$DefaultAttributeMatcher.matches(DefaultAttributesSchema.java:156)
at org.gradle.internal.component.model.AttributeConfigurationSelector.selectConfigurationUsingAttributeMatching(AttributeConfigurationSelector.java:40)
at org.gradle.internal.component.model.LocalComponentDependencyMetadata.selectConfigurations(LocalComponentDependencyMetadata.java:117)
at org.gradle.internal.component.local.model.DslOriginDependencyMetadataWrapper.selectConfigurations(DslOriginDependencyMetadataWrapper.java:60)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.calculateTargetConfigurations(EdgeState.java:166)
... 105 more
Моя версия Gradle:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
Я много искал, но не могу найти причину и решение проблемы. Кто-нибудь сталкивался с той же проблемой, что и я ??