https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
j

Jolas

05/25/2020, 1:00 PM
When I try to import a Kotlin Multiplatform Library as a module in Android Project I am getting this SQLdelight issue: https://github.com/cashapp/sqldelight/issues/1647. Does anyone know the root cause of this issue? Any suggestions on how to fix it would be helpful.
a

andrewreitz

05/26/2020, 2:32 AM
Are you trying to use a folder outside your gradle root folder?
Because I don’t think that’s a sqldelight issues, and more of not setting up gradle correctly.
Copy code
root
  shared
    data
    other-shared
  app
  backend
that’s how I would set it up.
j

Jolas

05/27/2020, 2:43 AM
Are you trying to use a folder outside your gradle root folder? - Yes.
Because I don’t think that’s a sqldelight issues, and more of not setting up gradle correctly. - The issue is happening even with fresh android project and fresh kotlin multiplatform shared library. No modifications done.
a

andrewreitz

06/01/2020, 6:50 PM
Yeah, I don’t think you can have a folder outside the root foler.
j

Jolas

06/04/2020, 6:08 PM
Andrew, having a module folder outside the root directory shouldn't be an issue. As you can see from that issue, using ln -s command and linking the folder solves the issue.
a

andrewreitz

06/08/2020, 5:21 PM
yeah the ln -s is a hack to allow the folder to be outside the root directory.
you should probably not do either of those things
j

Jolas

06/14/2020, 5:27 AM
What’s the reason?
a

andrewreitz

06/14/2020, 12:57 PM
Gradle is convention over configuration and the convention is you have a root project and then everything is inside that root project. As that ticket shows you can configure it but you’ll probably get odd behavior if you don’t follow the convention.
Looks like the author of the ticket came to this conclusion as well. https://github.com/cashapp/sqldelight/issues/1647#issuecomment-633680501
Gradle might support the configuration of moving a subproject outside the root directory, I haven’t asked them or anything, but IntellIJ and all the plugins that are included with intellij and gradle plugins may not support that so even if gradle did support it, it wouldn’t surprise me if something else went wrong since this isn’t a standard convention.
2 Views