Updating to 1.1.4 breaks android library modules
See original GitHub issueI’m in the process of upgrading from 1.0.3 to 1.1.4. I’ve manually added the android driver to all my modules.
When the Sqldelight plugin is applied to an Android application module (com.android.application
) everything is working flawlessly.
However, when applying the sqldelight plugin on an Android library module I’m getting compilation errors.
One such error is:
e: /Users/nik/dev/GitHub/vanniktech/feature-yatzy/build/sqldelight/QueryWrapper/com/vanniktech/feature/yatzy/feature/featureyatzy/QueryWrapperImpl.kt: (462, 13): Unresolved reference: PlayerId
The odd thing is that my package name is com.vanniktech.feature.yatzy
. Hence I’d expect the path to be:
-build/sqldelight/QueryWrapper/com/vanniktech/feature/yatzy/feature/featureyatzy/QueryWrapperImpl.kt
+build/sqldelight/QueryWrapper/com/vanniktech/feature/yatzy/feature/QueryWrapperImpl.kt
My sqldelight Gradle configuration block looks like this:
sqldelight {
QueryWrapper { }
}
My sql file is located in: ./src/main/sqldelight/com/vanniktech/feature/yatzy/io/model/Player.sq
and the missing reference (PlayerId
) is also inside the package com.vanniktech.feature.yatzy.io.model
.
Is there anything that sqldelight does differently when working with Android Library modules?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
unfortunately its not possible - theres no notion of a classpath when sqldelight is running its compiler, so we just let the kotlin compiler fail when it tries to resolve
@AlecStrong So, I’ve finally managed to find the root cause of this. I wasn’t importing one of my custom types. In previous versions, if the
.sq
file was in the same directory as the type (in this casecom.vanniktech.feature.yatzy.io.model
) everything just worked. With the update, the import will be written out with just the name and not with the package. Soimport PlayerId;
instead ofimport com.vanniktech.feature.yatzy.io.model.PlayerId;
.Would not it make sense to already yell when validating the
sq
file that the import can’t be resolved? That would have helped me 😄