Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unresolved reference when using Kotlin source files with a standalone compiler (kotlinc) #409

Open
LeCyberDucky opened this issue Dec 14, 2022 · 2 comments

Comments

@LeCyberDucky
Copy link

Hi,

I'm trying to use this extension with a simple, standalone Kotlin source file. The file looks like this:

fun main() {
    println("Hello, world!")
}

With this, I get an Unresolved reference: printlnkotlin(UNRESOLVED_REFERENCE).

I have found some past issues that look similar:
#73
#58

But I'm still not sure what I should do to make this work. Is there some kind of setting I need to change in order to work with standalone files?

I also saw that one issue mentioned something akin to a default Gradle directory or something, but, somehow, I can't find that issue anymore. Anyway, assuming that I have a completely fresh setup that has never touched a Gradle project, can I somehow make this work?

I have an installation of Android Studio, if that makes any difference. I have added the kotlinc and Java included with my Android Studio installation to my path, which enables me to compile my example file from the command line.

@themkat
Copy link
Collaborator

themkat commented Jan 15, 2023

What does the language server logs say? My main guess is that the resolution of the standard library fails. It should in theory load the standard library based upon the kotlinc location. If you can share the language server logs, we see for sure 🙂

@LeCyberDucky
Copy link
Author

So, as mentioned, I'm accessing Kotlin from my Android Studio installation. For good measure, I just completely removed that and reinstalled it, but the problem persists.

Here are my logs: https://gist.github.com/LeCyberDucky/99c6fdc537df2cc9b16f5ed0af0a88cd

I have the same setup on my laptop (same installation method and same directory structure), but I don't have the same problem there, which seems odd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants