之前的老项目突然就运行不了了,跳出如下报错:
Starting in Kotlin 2.0, the Compose Compiler Gradle plugin is required
when compose is enabled. See the following link for more information:
https://d.android.com/r/studio-ui/compose-compiler
废话不多说,最后发现是Kotlin和Compose的版本问题。
解决办法:
新建一个项目,查看可用的版本,如果没有导入特殊的依赖的话(比如navigation,Gson,ConstraintLayout),可以直接把模块下的build.gradle文件复制过来,另外,要删除项目跟目录下build.gradle的跟compose有关的那一行,如下注释的那行