composeOptions { kotlinCompilerExtensionVersion = 1.3.2 } //对应kotlin版本是1.7.20 Kotlin 版本和KSP版本对应关系 https://mvnrepository.com/artifact/com.google.devtools.ksp/com.google.devtools.ksp.gradle.plugin https://github.com/google/ksp/releases 比如1.7.20-1.0.8 表示kotlin版本1.7.20,ksp版本是1.0.8 classpath"com.google.devtoo...
kotlinCompilerVersion : 指定 Compose Compiler 版本,与 Compose 版本保持一致 kotlinCompilerExtensionVersion :指定 kotlin 的编译版本(KCP),与 kotlin-gradle-plugin 版本保持一致 其实,AGP 对 Compose 的影响仅仅只作用于 TaskManager 中是否有无添加 compose-compiler 依赖,如果 AGP 有,则 Compose 与 AGP 版本无关。
kotlinCompilerExtensionVersion” $kotlin_ _version" } } 5.2 Compose 在 AGP 不同版本的表现 ● AGP 4.2.0 以下不支持正式版本的 Compose。在查看 AGP 4.1.0 时,该版本内置的 compose-compiler 依赖是 androidx.compose:compiler,而正式版本的依赖是 androidx.compose.compiler:compiler ● AGP 4.2.0 开始支持...
在build.gradle文件中添加 Compose 相关的依赖项: android{...composeOptions{kotlinCompilerExtensionVersion='1.5.0'// 使用的Compose编译器版本}}dependencies{implementation'androidx.compose.ui:ui:1.5.0'// Compose UI库implementation'androidx.compose.material:material:1.5.0'// Material Design库implementation'...
composeOptions { kotlinCompilerExtensionVersion = 1.3.2 } //对应kotlin版本是1.7.20 Kotlin 版本和KSP版本对应关系 https://mvnrepository.com/artifact/com.google.devtools.ksp/com.google.devtools.ksp.gradle.plugin
composeOptions { kotlinCompilerExtensionVersion = "1.3.0" } 然后就可以正常的运行了。由于Android由Java向Kotlin过渡,所以存在很多的版本兼容的问题,这些问题让开发者比较头疼,所以遇到问题一定要多上网查查。 Android 学习笔录 Android 性能优化篇:qr18.cn/FVlo89Android 车载篇:qr18.cn/F05ZCMAndroid 逆向安全学...
kotlinOptions { jvmTarget ="1.8"} buildFeatures { compose =true} composeOptions { kotlinCompilerExtensionVersion ="1.5.1"} packaging { resources { excludes +="/META-INF/{AL2.0,LGPL2.1}"} } } dependencies { implementation("androidx.core:core-ktx:1.10.1") ...
我这边使用的是1.3.1,对应kotlin版本是1.7.10,工程中build.gradle: android{buildFeatures{ composetrue}composeOptions{ kotlinCompilerExtensionVersion="1.3.1"}kotlinOptions{ jvmTarget="1.8"} } 主工程中build.gradle: plugins {id'com.android.application'version'7.3.1'applyfalseid'com.android.library'version...
[versions]kotlin = "2.0.0"[plugins]compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } 3.在项目的根目录 build.gradle.kts 文件中,将以下内容添加到插件部分 接下来,咱们得在项目的根目录 build.gradle.kts 文件中,给插件部分“加点料”。这就像是在你的...
我上周更新到 Kotlin 1.5,在昨天看到 Google 打算让 Jetpack Compose 成为设计 UI 的首选选项后,我想做一些测试。 问题是将我的项目更新到 Kotlin 1.5,在尝试构建项目时出现以下错误: This version (1.0.0-beta07) of the Compose Compiler requires Kotlin version 1.4.32 but you appear to be using Kotlin ...