警告: Schema export directory is not provided to the annotation processor so we cannot export the schema. You can either provide `room.schemaLocation` annotation processor argument OR set exportSchema to false.
public abstract class MyRoomDatabase extends RoomDatabase {

未向批注处理器提供架构导出目录,因此无法导出架构。你可以提供room.schemaLocation注释处理器参数或将exportSchema设置为false

解决方法


1、在build gradle中添加(推荐)

javaCompileOptions {
    annotationProcessorOptions {
        arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
    }
}

2.exportSchema = false

更多推荐