Status Update
Comments
yb...@google.com <yb...@google.com> #2
For Kotlin 2.0 and KSP 2.0 the Cannot change attributes of configuration ':composeApp:debugFrameworkIosX64' after it has been locked for mutation
really seems like a KSP issue. You should file a bug in their repository with a sample app if possible.
If you downgrade to Kotlin 1.9 then things 'should' work, there are example apps out there with such configuration, like the following one:
da...@google.com <da...@google.com> #3
Will try to use the example provided by you to check if it fixes the issue.
ap...@google.com <ap...@google.com> #4
Note that this issue happens when applying the Compose, KSP and Room Plugin together in Kotlin 2.0.x, the workaround for now is to not use the Room Gradle Plugin and instead specify the schema location vis KSP arguments:
// In the build.gradle
ksp {
arg("room.schemaLocation", "${projectDir}/schemas")
}
da...@google.com <da...@google.com>
an...@google.com <an...@google.com> #5
Hi, I encountered a similar problem and was able to resolve it by updating the dependencies
room = "2.7.0-alpha08"
ksp = "2.0.20-1.0.25"
compose-plugin = "1.6.11"
kotlin = "2.0.20"
Description
Version used: 2.2.3
Devices/Android versions reproduced on: n/a
Android Studio 3.5.3
Build #AI-191.8026.42.35.6010548, built on November 15, 2019
JRE: 1.8.0_202-release-1483-b49-5587405 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.3.0-24-generic
Steps to Reproduce:
1. Import the attached project into Android Studio (tested on 3.5.3)
2. Attempt to build the InterfaceSuspend module
Expected Results: A clean build
Actual Results: A build error:
error: Bookstore_Impl is not abstract and does not override abstract method loadCategoryByTransaction(String,Continuation<? super Pair<Category,? extends List<Book>>>) in Bookstore
public final class Bookstore_Impl implements Bookstore {
^
1 error
Here, Bookstore is a Kotlin interface with a @Dao annotation, defining a concrete suspending function that calls two other functions that should get code-generated:
@Dao
interface Bookstore {
@Insert
suspend fun save(category: Category)
@Insert
suspend fun save(vararg books: Book)
suspend fun loadCategoryByTransaction(shortCode: String) =
_loadCategory(shortCode) to _loadBooksInCategory(shortCode)
@Query("SELECT * FROM categories WHERE shortCode = :shortCode")
suspend fun _loadCategory(shortCode: String): Category
@Query("SELECT * FROM books WHERE categoryShortCode = :shortCode")
suspend fun _loadBooksInCategory(shortCode: String): List<Book>
}
If you switch this to be an abstract class, it compiles (see the AbstractSuspend module). If you add @Transaction to the function on the interface, it compiles (see the InterfaceTransaction module), though there's a separate bug with that (to be filed shortly).
Let me know if you need more details -- thanks!