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.

Database interface occasionally not resolved

See original GitHub issue

Our project has one module (named sqldelight) that depends on SqlDelight directly, and all SqlDelight code (sq files, Kotlin classes referenced in sql files, etc…) as well as some helpers that wrap the generated Database for certain things is in that module. There is another module (models) that has an api dependency on our sqldelight module, and any other module that needs access to Database depends on models.

For the past few months on our CI machines, the :sqldelight:compileReleaseKotlin occasionally fails with every file in that module that references Database saying that it is an unresolved reference. Running it again usually works. We originally though it was a build cache issue, but we’ve disabled that and it still happens.

Lately it has also been happening in Android Studio. Database is highlighted in red with the error Unresolved reference: Database but compilation works, and the generated interface is in the build directory. The only way to fix it is to restart and invalidate caches.

I’ve noticed that it tends to happen more often when switching between our dev branch and a long lived feature branch that we have (around 50k lines difference between them and many modules renamed, created, and removed).

What’s the best way to further debug this?

Build Environment SQLDelight version: 1.4.4 OS: Ubuntu 20.04 Gradle version: 6.7.1 Kotlin version: 1.4.20 AGP Version (if applicable): 4.1.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:23 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
AlecStrongcommented, Apr 15, 2021

this should be fixed on master now that we dont reuse an outputdirectory for different variants

3reactions
veyndancommented, Jan 6, 2021

@RamenSea If you’re referring to this block:

sqldelight {
  Database { // This will be the name of the generated database class.
    packageName = "com.example"
  }
}

then Database can be whatever name you want. Maybe you just need to rename database to Database here? If not, please create a separate issue with the details.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving could not open a connection to SQL Server errors
Sometimes you may have issues connecting to SQL Server and you may get messages such as could not open a connection to SQL...
Read more >
Troubleshoot common connection issues to Azure SQL ...
These connection problems can be caused by reconfiguration, firewall settings, a connection timeout, incorrect login information, or failure to ...
Read more >
Why is My Database "Read-Only" After Moving to a New ...
Right-click on the database you need to allow Read-Write access. Click Properties at the bottom of the list. In the Database Properties -...
Read more >
The 2022 Guide to Repairing WordPress Database Issues
It's almost impossible to run a website and not occasionally come up against a problem. But how do you know it's the database...
Read more >
Diagnosing and Resolving Problems - Oracle Help Center
An Oracle Database component can detect conditions, states, or events that are unusual, but which do not inhibit correct operation of the detecting...
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