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.

Global collection initializer functions shown as "unresolved reference"

See original GitHub issue

When 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.

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
alxndrvcommented, Oct 24, 2018

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 from

compile {
    implementation "org.jetbrains.kotlin-stdlib-jdk7:$kotlin-version"
}

to

compile {
    implementation "org.jetbrain.kotlin-stdlib:$koltin-version"
}

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. 😃

1reaction
fwcdcommented, Oct 4, 2018

That’s unfortunate. I will let you know if I find anything.

Read more comments on GitHub >

github_iconTop 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 >

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