Skip to content

Weird issue resolving dep in AS after using KI #124

@fluxxion82

Description

@fluxxion82

Ok, so I'm this weird issue and not entirely sure what's going on, and hoping here can give me some insights.

I was doing some work in Android Studio, and wanted to test something out related to kotlinx datetime quickly, so I go to the command line and open KI. I try to add the repository, dependsOn, and import classes but couldn't get things to work right. This was the first time I had tried adding a maven repo and trying to access a library with KI. I never got it to work so I went to Intellij and did my test.

I go back to AS and it now can't resolve the kotlinx datetime library anymore (specifically for the version I was trying to use in KI). I cleared my gradle caches, uninstalled KI, reboot my computer but nothing has worked.

I added a resolutionStrategy in my build file to force the project to use an earlier version of kotlinx datetime and that gets the project working again, but I can't use the latest version, or at least the version i was using previously. My intellij project seems to be working ok with the latest datetime library.

The error in AS that I get is Unresolved reference errors. I'm using AS Flamingo Beta 4 (also have issues with Giraffe). On a mac m1.

example KI input:

[0] :repository https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-datetime/0.4.0
[1] :dependsOn org.jetbrains.kotlinx:kotlinx-datetime:0.4.0
WARNING File 'org.jetbrains.kotlinx:kotlinx-datetime:0.4.0' not found (Line_2.kts:1:1)
WARNING org.jetbrains.kotlin.org.eclipse.aether.resolution.DependencyResolutionException: Failed to read artifact descriptor for org.jetbrains.kotlinx:kotlinx-datetime:jar:0.4.0 (Line_2.kts:1:1)
[2] import kotlinx.datetime.Instant
ERROR Unresolved reference: datetime (Line_3.kts:1:16)
[3] :repository https://repo.maven.apache.org/maven2/
[4] :dependsOn org.jetbrains.kotlinx:kotlinx-datetime:0.4.0
[5] import kotlinx.datetime.Instant
ERROR Unresolved reference: Instant (Line_6.kts:1:25)
[6] import kotlinx.datetime.*
[7] :dependsOn org.jetbrains.kotlinx:kotlinx-datetime:0.4.0
[8] import kotlinx.datetime.*
[9] var insta = Instant.now().toString()
ERROR Unresolved reference: Instant (Line_10.kts:1:13)
[10] 

there were times I would add a repo and the dependsOn wouldn't complain, but then KI could only see this package and no classes in the package, kotlinx.datetime. I tried add the * to maybe see if that would catch the classes but no luck. I tried a bunch of different repositories but never actually got something to work.

I'm at a loss of what the issue could be or what else I can do. I'm wondering if there's anyway that KI could have affected what I'm seeing with AS, and if anyone has any ideas what could be causing the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions