https://kotlinlang.org logo
#android
Title
# android
a

Andy Victors

05/14/2019, 12:14 PM
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

ribesg

05/14/2019, 12:21 PM
What Gradle version are you using?
a

Andy Victors

05/14/2019, 12:21 PM
4.10.1
r

ribesg

05/14/2019, 12:21 PM
I’m using 5.4.1 and it works
a

Andy Victors

05/14/2019, 12:23 PM
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

ribesg

05/14/2019, 12:25 PM
What version of Ktor are you using ?
a

Andy Victors

05/14/2019, 12:27 PM
1.1.3
r

ribesg

05/14/2019, 12:27 PM
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

Andy Victors

05/14/2019, 12:41 PM
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

ribesg

05/14/2019, 12:47 PM
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

Andy Victors

05/14/2019, 12:48 PM
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