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.

Unresolved reference: android

See original GitHub issue

Hello, My kotlin version is 1.3.61.

My error :

e:  Unresolved reference: android
e:  Unresolved reference: AndroidSqliteDriver

This is my build.gradle.

commonMain {
    dependencies {
        api 'org.jetbrains.kotlin:kotlin-stdlib-common'
    }
}
androidMain {
    dependencies {
        api 'org.jetbrains.kotlin:kotlin-stdlib'
        implementation "com.squareup.sqldelight:android-driver:1.2.2"
    }
}
iosMain {
    dependencies {
        api 'org.jetbrains.kotlin:kotlin-stdlib'
        implementation "com.squareup.sqldelight:native-driver:1.2.2"
    }
}

This is my code in androidMain :

val kodein = Kodein.Module("driver") {
    bind<SqlDriver>("androidDriver") with singleton {
        AndroidSqliteDriver(MyDatabase.Schema, instance(), "iosDatabase.db")
    }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
AlecStrongcommented, May 28, 2020

cool. I’m gonna close out this issue as thats likely whats happening for most projects.

0reactions
plusmobileappscommented, May 28, 2020

Using that repository you linked @AlecStrong , I was able to fix the issue of not resolving the AndroidSqliteDriver. It did require adding the android library plugin and android configuration in the shared code build.gradle.kts. Then I also needed to add an AndroidManifest.xml to get the project to sync.

I am still struggling getting the database schema object to be generated, but will work on that in a separate issue.

Thanks for the help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Studio 3.1: Erroneous unresolved references in editor
16 Answers 16 · Invalidate Cache and restart Android Studio · Delete .build, app/build, and .idea · Sync Gradle files · Enable and...
Read more >
How to fix unresolved reference issue in Kotlin and Android ...
To conclude, the unresolved reference error happens when Kotlin has no idea what the keyword you're typing in the file points to. It...
Read more >
Unresolved reference: android · Issue #1393 · gradle/kotlin-dsl ...
The solution in my case was to completely remove the android {} block, do a gradle sync, and then add it back.
Read more >
Gradle Kotlin const randomly "unresolved reference" until file ...
I have a FooConstants.kt file with a bunch of constants that are referenced in Kotlin and Java code. Every once in a while...
Read more >
Android Studio and Kotlin: Unresolved reference: also
Yet the editor highlights also and it as errors and don't give any help with intellisense. apply still works and when I go...
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