当前位置:网站首页>Warning using room database: schema export directory is not provided to the annotation processor so we cannot export

Warning using room database: schema export directory is not provided to the annotation processor so we cannot export

2022-07-05 05:19:00 Novice Xiaowang

Warning : 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 {

Not provided to annotation processor framework Export directory , Therefore, the schema cannot be exported . You can provide room.schemaLocation Annotate processor parameters or exportSchema Set to false

resolvent


1、 stay build gradle Add ( recommend )

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

2.exportSchema = false

原网站

版权声明
本文为[Novice Xiaowang]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207050512499835.html