Wnen I upgrades to Kotlin multiplatform 1.5.1 I st...
# multiplatform
j
Wnen I upgrades to Kotlin multiplatform 1.5.1 I start getting errors in duplicate kotlin symbols for iOS build, like:
duplicate symbol '_ktypew:kotlin.Function20' in
presentation/build/cocoapods/framework/presentation.framework/presentation(libstdlib-cache.a.o)
shared/build/cocoapods/framework/shared.framework/shared(libstdlib-cache.a.o)
Both presentation and shared is pods using cocoapods plugin. And presentation is depend on shared. Probably some new config changes as how merge resources or such I need to change or any ideas?
p
Are you trying to use both libraries/modules in your swift project? It seems that you have a problem because the same shared library exists in two dependencies and the linker doesn't know which one to pick. Can you share the build.gradle scripts?a
j
Yes both. Both cocoapods and using static flag for framework binaries. Can share later on part of it :) Main issue I need shared in both Android and iOS and same for presentation. And presentation depends on shared.
p
Don't worry about sharing if it is closed source. Is ok. Afaik your swift project can only depend on one KMP umbrella framework. Try to design your modules such as : iosApp -> shared-umbrella Then shared-umbrella depends on your current presentation and shared modules.
Also you can try including the duplicate library as api in a common module consumed by both shared and presentation
j
Yeah well I had to do that earlier cause structure of iOS and KMP shared resources. Now changes again in KMP plugin 😁 Does KMP merged all shared resources across Gradle modules and cocoapods now?
The duplicate is kotlin multiplatform 😁
p
Oh I see, uff I know that feeling.
j
But yeah I need to refactor the entire structure it seems
p
I migrated from cocoapods time ago
j
This was a hack because well cocoapods sucks and cant use anything else for shared resources 🀣
p
So can't really tell much about it
I know yeah
j
Had to use it. Any sample project so I cant throw cocoapods in trash?
Does KMP support Swift packades now for shared resources in jetbrains resources?
If so i gladly switch. This the reason i want use KMP. To not care about iOS binaries and symbols. And still end up doing it 😁
p
I saw something about it in the latest dev release
But haven't played with it yet
j
Maybe I missed it in 1.5.0 release. Checked releasenotes.
Ideally want KMP share my Gradle module to iOS app automatic
p
Is 1.6.0-dev something
j
Dont want to expose anything to iOS.
Amper where are you ;)
p
Jeje
j
Also they deleted the iOS textfield without mention 😁
p
Oh I haven't noticed it
Now has a different name?
j
Easy fixing. But oboy what a large amount of refactoring needed. No best practices either in documentation at all in any sample project. How sharing fonts, strings, images in multi Gradle project using KMP 😁
No they just delete it because fixed material compose textfield work with iOS textfield properly now.
p
Very hacky at the moment yes
j
Did my own polyfill to solve it 🀣
😁 1
Praying for beta state soon 😁
p
KMP chatgpt plugin lol
πŸ˜„ 1
j
Looking forward when my custom font loader stop working 🀣
Yeah I wish chatgpt train in real time on latest KMP dev snapshots 🀣
GitHub copilot please 😁
p
Yeah right!
j
But anyway need to get rid of my cocoapods. Any sample how using jetbrains resources without cocoapods?
p
I think the official template is not using it anymore
j
Which one is that 😁 So many random GitHub samples out there xD
p
There is a PR where Igor demin did the migration
Give me a second
j
Really. Would need a nowinandroid equivalent of cmp and KMP best practices from jetbrains. Tried check Tivi from Chris Banes as well. But the new dsl for KMP 1.5.0 iOS is really nice. Just missing migration release notes how.
But yeah I depend on alpha iOS, my own fault.
I checked https://blog.jetbrains.com/kotlin/2023/08/compose-multiplatform-1-5-0-release/ But not mentioned how migrate away from cocoapods
They link to https://github.com/JetBrains/compose-multiplatform/pull/3496 But removing extra metadata not helping :)
πŸŽ‰ 1
p
Yes that is the PR, sorry wasn't Igor but Alexey
j