Chapter 12 - Coroutines & DBs - Challenge Error

In the challenge for Chapter 12, one option is to add

javaCompileOptions {
annotationProcessorOptions {
arguments += [“room.schemaLocation”: “$projectDir/schemas”.toString(),]
}
}

However, I’m getting 2 errors:

  1. on the ‘+=’ operator I’m getting an “overload resolution ambiguity” error
  2. on the value part I’m getting an “unexpected tokens” error

Try the code listed with the Kotlin syntax here: Room  |  Jetpack  |  Android Developers

I bet your project is using the Kotlin build scripts and the book assumes that people are using the old Groovy syntax.

Thank you. Using the referenced snippet, did get the code to build. However, after a grade sync, a build and a run, shouldn’t that result in a /schema directory and a json file in it? I see no directory or json file.

Yes there should be a file somewhere within the ./app/schemas directory within your project. The “Android” view within the project file viewer hides it, so try switching to the basic “Project” view for the file viewer.

Screenshot 2023-08-22 at 10.13.15 AM

I added the gradle changes per the docs you referenced

but there is still on /schemas directory being added