Skip to content

[Bug]: KSP apoption does not match \S+=\S+: room.schemaLocation #604

@rafsanahmad

Description

@rafsanahmad

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

What happened?

While running the project on SImulator or Real device, it is showing error.

Android Studio Electric Eel | 2022.1.1 Patch 1
OS: Mac Ventura 13.2.1

FAILURE: Build failed with an exception.

  • What went wrong:

Configuration cache state could not be cached: field __options__ of task :core:database:kspDemoDebugKotlin of type com.google.devtools.ksp.gradle.KspTaskJvm: error writing value of type 'org.gradle.api.internal.provider.DefaultListProperty'

KSP apoption does not match \S+=\S+: room.schemaLocation=YOUR_PROJECT_DIR/nowinandroid/core/database/schemas

The problem arises from NiaDatabase.kt -> exportSchema is set to true. Room generate Database script and save them as JSON file in your local directory.

AndroidRoomConventionPlugin.kt -> Configures room schema location to export scheme using com.google.devtools.ksp. This plugin is used in build.gradle.kts (Module :core:database)

Line causing the error:

override fun asArguments() = listOf("room.schemaLocation=${schemaDir.path}")

If your project is within a folder that has space in its name, like mine, the Regex is failing as \S+=\S+ does not match in KSP.

Setting exportSchema = false also does not solve the problem. If you give a path in your schemaDir which does not contain space, build completes successfully.

can you suggest a proper solution, so it does not depend on whitespace in your schemaDIr.

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions