Hey, after switching to different computer I start...
# multiplatform
j
Hey, after switching to different computer I started getting error on code which was working and is still working on different environment. I was trying to clean cache - ./gradlew clean, delete build folder, invalidate cache but nothing works. Still getting this error on one of my computers, on others it is working normally. I am getting this error after trying to generate .xcframework, command - ./gradlew assembleXCFramework. *kotlin version - 1.8.10 *kotlinx-serialization-core - 1.5.0 *gradle plugin version - 7.3.1 *gradle version - 7.6 Can anyone help?
ł
Try changing gradle from 7.6 to 7.6.1 maybe it will help. I had a similar problem and changing gradle helped me.
j
Changing gradle version does not help. Also I would like to understand what is the difference between environments that it works on some and not on others.
c
Are all your Macs M1 or M2 or are the ones that work Intel Macs?
j
I've used it on three different iMacs with the same configuration - iMac (Retina 5K, 27-inch, Late 2015), on one of them the build works, on the other two it doesn't. I also used it on a Macbook Pro M1 where it worked.
j
Did you run kdoctor?
j
I ran "kdoctor -v" on both working and not working IMac, here are the results:
On both I am receving response that my system is ready for Kotlin Multiplatform Mobile Development. The only difference that I can see between those two environments is version of kotlin plugin and kotlin multiplatform mobile plugin. Is it possible that it is the cause of the problem?
j
Do you have a reason to hold back updating dependency versions or any other application versions on any of these machines? I'd recommend updating all of these to the latest versions on all systems, including dependencies, Android Studio, plugins, Kotlin, Xcode, Ruby, cocoapods, etc. On each system some of these are newer and some are older. The error looks to be specifically related to the
org.jetbrains.kotlinx:kotlinx-serialization-json
dependency. Somewhere it's being built with an old 1.4.1 version, while another dependency requires 1.5.0. The latest is 1.5.1.
What's the full dependency graph output?
./gradlew dependencies
This should point to where the 1.4.1 version is depending from.
ł
I had almost the same problem but changing gradle helped. Just for testing try downgrading kotlin from 1.8.10 to 1.7.20