New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: KSP apoption does not match \S+=\S+: room.schemaLocation #604
Comments
This seems like a bug in KSP where "spaces" chars ( |
Here is the corresponding error thrown by KSP: We could try to escape spaces with something like, but I'm not sure it's worthy: - override fun asArguments() = listOf("room.schemaLocation=${schemaDir.path}")
+ override fun asArguments() = listOf("room.schemaLocation=${schemaDir.path.replace(" ", "\\ ")}") |
Or maybe something even simpler: - override fun asArguments() = listOf("room.schemaLocation=${schemaDir.path}")
+ override fun asArguments() = listOf("room.schemaLocation=\"${schemaDir.path}\"") Could you try this on your local machine @rafsanahmad? |
Thanks, @SimonMarquis for the suggestion. I tried both of the above ways earlier before posting the issue. but still, it failed to build the project giving the same KSP adoption error. For now, the solution seems to be: move the project to a directory that does not contain space in its path or give a pre-defined path directory without spaces.
|
I'm also getting the same error on Windows with Android Studio Electric Eel | 2022.1.1 |
I had the same error - unfortunately the root directory for my pc had white space, so there was no way i could bypass this as @rafsanahmad had sugest. What i did to solve this error:
|
@rafsanahmad Since this issue is not direclty related to the project (and we can't fix it on our end), I think we can close it. |
Is there an existing issue for this?
Is there a StackOverflow question about this issue?
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.
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 usingcom.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 yourschemaDir
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
The text was updated successfully, but these errors were encountered: