question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Updating to 1.1.4 breaks android library modules

See original GitHub issue

I’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:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AlecStrongcommented, Sep 2, 2019

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

0reactions
vanniktechcommented, Sep 2, 2019

@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 case com.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. So import PlayerId; instead of import 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 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Recent Support Library Revisions - Android Developers
This page provides details about the most recent Support Library package releases. For earlier releases, see the Support Library Revisions Archive.
Read more >
Duplicate class android.support.v4.app ... - Stack Overflow
Now, my project (Match4app) works with AndroidX and I was able to publish it in the PlayStore without any issues. Comment: This task...
Read more >
Upgrading Android Gradle plugin from 1.0.1 to 1.1.* breaks ...
android.base into Android Studio. 2. Open any class with a dependency on net.i2p.* (e.g. net.i2p.util.LogWriter in the client module). 3. Observe that Android...
Read more >
Releases · material-components/material-components-android
Modular and customizable Material Design UI components for Android - Releases ... Update documentation (697156a); Update library version to ...
Read more >
Blog - Apache Cordova
All plugins that continue to use the Android Support Library will need to be updated to reference the new AndroidX library. If plugins...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found