Unresolved reference: android
See original GitHub issueHello, 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:
- Created 3 years ago
- Reactions:4
- Comments:9 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
cool. I’m gonna close out this issue as thats likely whats happening for most projects.
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 codebuild.gradle.kts
. Then I also needed to add anAndroidManifest.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!