Global collection initializer functions shown as "unresolved reference"
See original GitHub issueWhen working with a Gradle project previously created in Intellij IDEA, the global functions mapOf
, listOf
, emptyMap
, and similar all display as unresolved references. I’m not sure if this is a project configuration issue caused by moving from Intellij to VSCode, or if it’s a bug, as I don’t have any other types of projects available to test with.
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Global collection initializer functions shown as "unresolved ...
When working with a Gradle project previously created in Intellij IDEA, the global functions mapOf, listOf, emptyMap, and similar all display as unresolved...
Read more >Unresolved reference: launch - gradle - Stack Overflow
It's declared as public object GlobalScope : CoroutineScope within the kotlinx-coroutines package. – Paul Stelian. Sep 13, 2019 at 10:56. 2.
Read more >Unresolved reference for stdlib collections folder as it is empty
In, quite literally a hello world project the IDE seems to think println and any other parts of kotlin.io are not resolved. Unresolved...
Read more >[Solved]-How to fix "unresolved reference: int" in Kotlin-kotlin
Coding example for the question How to fix "unresolved reference: int" in Kotlin-kotlin.
Read more >Navigation | Android Developers
You must have android.useAndroidX=true in your gradle.properties file as per Migrating to AndroidX. For information on using Kotlin extensions, ...
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 Free
Top 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
I was experiencing this issue along with #51 in my Android project using Gradle. I managed to fix this by changing the Kotlin dependency in my
build.gradle
fromto
After changing that line and cleaning/re-building the project both primitive types and global collection initializers started getting recognised by the language server. My project seemed to compile and work properly regardless of the change. While this doesn’t properly fix the issue, it might be a viable temporary solution.
Hope this helps. 😃
That’s unfortunate. I will let you know if I find anything.