android room exportSchema

android room exportSchema

设置exportSchema=true

需要添加依赖

build.gradle.kts  

plugins {
// ...
val room_version = "2.8.3"
id("androidx.room") version "$room_version" apply false
}


app:  build.gradle.kts
plugins {
//...
    id("androidx.room")
}
room {
// Specify the directory (e.g., in the project root)
schemaDirectory("$projectDir/schemas")
}

来源:https://developer.android.com/jetpack/androidx/releases/room#gradle-plugin



posted on 2025-12-31 22:44  少杨  阅读(0)  评论(0)    收藏  举报