无法使用Kotlin 1.2.70在Linux上编译项目

时间:2018-09-19 07:39:45

标签: android gradle kotlin

将Kotlin从1.2.61更新到1.2.70后,当尝试使项目Android Gradle插件v3.1.4合并时,会出现此错误

 Could not resolve all dependencies for configuration 
 ':app:debugImplementationDependenciesMetadata'.
  > Could not resolve project :appstart.
 Required by:
     project :app
  > Unable to find a matching variant of project :appstart:
      - Variant 'debugApiElements':
          - Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required.
          - Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
          - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
          - Found org.gradle.usage 'java-api' but wasn't required.
          - Required org.jetbrains.kotlin.platform.type 'common' and found incompatible value 'androidJvm'.
      - Variant 'debugRuntimeElements':
          - Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required.
          - Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
          - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
          - Found org.gradle.usage 'java-runtime' but wasn't required.
          - Required org.jetbrains.kotlin.platform.type 'common' and found incompatible value 'androidJvm'.
      - Variant 'releaseApiElements':
          - Found com.android.build.api.attributes.BuildTypeAttr 'release' but wasn't required.
          - Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
          - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
          - Found org.gradle.usage 'java-api' but wasn't required.
          - Required org.jetbrains.kotlin.platform.type 'common' and found incompatible value 'androidJvm'.
      - Variant 'releaseRuntimeElements':
          - Found com.android.build.api.attributes.BuildTypeAttr 'release' but wasn't required.
          - Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
          - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
          - Found org.gradle.usage 'java-runtime' but wasn't required.
          - Required org.jetbrains.kotlin.platform.type 'common' and found incompatible value 'androidJvm'.

我可以在Mac OS上毫无问题地编译此项目。我有0个通用模块。

我能解决该问题吗?

UPD: 将Android Studio Gradle插件更新为3.2.0-rc03之后,我的堆栈跟踪有所不同

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration 
':app:debugImplementationDependenciesMetadata'.
> Could not resolve project :appstart.
 Required by:
     project :app
  > Cannot choose between the following variants of project :appstart:
      - kapt
      - kaptAndroidTest
      - kaptAndroidTestDebug
      - kaptDebug
      - kaptRelease
      - kaptTest
      - kaptTestDebug
      - kaptTestRelease
    All of them match the consumer attributes:
      - Variant 'kapt':
          - Found artifactType 'processed-jar' but wasn't required.
          - Required org.jetbrains.kotlin.platform.type 'common' but no value provided.
      - Variant 'kaptAndroidTest':
          - Found artifactType 'processed-jar' but wasn't required.
          - Required org.jetbrains.kotlin.platform.type 'common' but no value provided.
      - Variant 'kaptAndroidTestDebug':
          - Found artifactType 'processed-jar' but wasn't required.
          - Required org.jetbrains.kotlin.platform.type 'common' but no value provided.
      - Variant 'kaptDebug':
          - Found artifactType 'processed-jar' but wasn't required.
          - Required org.jetbrains.kotlin.platform.type 'common' but no value provided.
      - Variant 'kaptRelease':
          - Found artifactType 'processed-jar' but wasn't required.
          - Required org.jetbrains.kotlin.platform.type 'common' but no value provided.
      - Variant 'kaptTest':
          - Found artifactType 'processed-jar' but wasn't required.
          - Required org.jetbrains.kotlin.platform.type 'common' but no value provided.
      - Variant 'kaptTestDebug':
          - Found artifactType 'processed-jar' but wasn't required.
          - Required org.jetbrains.kotlin.platform.type 'common' but no value provided.
      - Variant 'kaptTestRelease':
          - Found artifactType 'processed-jar' but wasn't required.
          - Required org.jetbrains.kotlin.platform.type 'common' but no value provided.

0 个答案:

没有答案