android room Schema export directory is not provided to the annotation processor so we cannot export the schema.

解决:
android {
    compileSdk 31

    defaultConfig {
        applicationId "com.xxxxx.xxxx"
        minSdk 24
        targetSdk 31
        versionCode 7
        versionName "1.1.4"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        //指定room.schemaLocation生成的文件路径
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }
    }

 

 

 

posted @ 2022-07-15 15:13  jiduoduo  阅读(337)  评论(0编辑  收藏  举报