lroxanne / note

0 stars 0 forks source link

Room cannot export the schema #1

Open davidyh3 opened 2 months ago

davidyh3 commented 2 months ago

I am experiencing the following error. Any methods that can help me solve it?

C:\Users\yuhan\AndroidStudioProjects\note\app\build\tmp\kapt3\stubs\debug\com\example\note1\data\database\NoteDatabase.java:10: �x��: Schema export directory was not provided to the annotation processor so Room cannot export the schema. You can either provide `room.schemaLocation` annotation processor argument by applying the Room Gradle plugin (id 'androidx.room') OR set exportSchema to false.
public abstract class NoteDatabase extends androidx.room.RoomDatabase {
                ^
davidyh3 commented 2 months ago

adding

javaCompileOptions {
    annotationProcessorOptions {
        arguments(mapOf("room.schemaLocation" to "${projectDir}/schemas".toString()))
    }
}

could fix this error but new errors occur.