想要升级导航版本到2.4.0-rc01,但在进行升级时遇到了以下错误:
This version (1.0.5) of the Compose Compiler requires Kotlin version 1.5.31 but you appear to be using Kotlin version 1.6.0 which is not known to be compatible.
有人成功让这个工作了吗?
编辑:我的 build.gradle
项目:
buildscript {
ext {
kotlin_version = '1.5.31'
navigation_version = '2.4.0-rc01'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigation_version"
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
}
}
App
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-parcelize'
id 'kotlin-kapt'
id 'androidx.navigation.safeargs.kotlin'
id 'dagger.hilt.android.plugin'
id 'com.google.secrets_gradle_plugin' version '0.4'
}
android {
signingConfigs {
debug {
storeFile file('C:\\Users\\olive\\.android\\debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
compileSdkVersion 31
buildToolsVersion "29.0.3"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
buildFeatures {
viewBinding true
dataBinding true
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.0.5'
kotlinCompilerVersion '1.5.31'
}
}
顺便提一下,我看到kotlinCompilerVersion已被弃用。不确定是否有影响,但仍然收到相同的消息。
build.gradle
的内容。 - Sercan Sebetçi