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.
위 경고 메시지는 Room 라이브러리를 사용해서 데이터베이스 스키마를 생성할 때 exportSchema 설정에 의해 위의 경고가 뜬다.
exportSchema는 Boolean 타입으로 데이터베이스 스키마를 폴더로 내보낼지 정할 수 있다.
default 값이 true로 되어있는데 폴더 경로를 정해줘야 한다.
경로를 정해주지 않으면 위의 경고가 발생하며, 경로를 설정하는 방법은 다음과 같다.
build.gradle(App)에서 defaultConfig 하위 섹션에 스키마 경로를 작성하면 된다.
android {
...
defaultConfig {
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
}
경로를 설정하고 싶지 않다면 옵션을 false로 두는 것으로 경고 문구를 피할 수 있다.
'Android > 이슈 처리' 카테고리의 다른 글
[Android] Execution failed for task ':app:checkDebugDuplicateClasses' ··· (0) | 2023.05.11 |
---|---|
[Android] Deprecated Gradle features were used in ··· (0) | 2023.04.05 |
[Android] Failed to instantiate test runner class ··· (0) | 2023.03.22 |
[Android] An instance of PagingSource was re-used ··· (0) | 2023.03.17 |
[Android] :app:hiltJavaCompileDebug (0) | 2023.03.16 |
댓글