I'm getting `Unresolved reference ` for `ktor`symb...
# android
a
I'm getting
Unresolved reference
for `ktor`symbols inside the MPP code. This should be solved by adding
enableFeaturePreview("GRADLE_METADATA")
but then I get error messages on other dependencies:
Copy code
Caused by: java.lang.RuntimeException: Unsupported format version '0.3' specified in module metadata. This version of Gradle supports format version 0.4 only.
	at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.ModuleMetadataParser$1.transform(ModuleMetadataParser.java:80)
. It is possible to have a workaround to have both?
r
What Gradle version are you using?
a
4.10.1
r
I’m using 5.4.1 and it works
a
I'll try with 5.x now, but I think the problem is with this particular dependency with older metadata format. I wonder why both could not be supported by gradle.
r
What version of Ktor are you using ?
a
1.1.3
r
You’re using an old version, problems are expected
Upgrade to 1.1.5, or even better, 1.2.0 which has been out for minutes already
Multiplatform is very experimental so you need to make sure to always use the latest versions of everything. You should also try alpha/beta/rc versions when available. Things change quickly and if you don’t adapt to changes immediately you may find yourself under a huge pile of changes
a
I see that. Trying to upgrade and match all versions. Getting:
ERROR: Failed to resolve: io.ktor:ktor-network:1.1.5
Previously I had only
implementation "io.ktor:ktor-client:$ktor_version"
in gradle
Ok, I solved the maven repository issue. But unfortunately after all my body movements the main issue still remains - ktor imports are red and the project does not compile. Cleaning caches, .gradle, .idea folders did not help. 😕
image.png
r
Do you have these repositories
Copy code
maven("<https://dl.bintray.com/kotlin/kotlinx>")
maven("<https://dl.bintray.com/kotlin/ktor>")
Also I have 12 ktor dependencies, not just 1
a
now yes. gradle runs ok
Thank you again for your help. At least the project compiles now. The dependencies are still displayed red, just hope it will go away with later gradle/as versions