https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
j

Joel Denke

11/17/2023, 8:07 AM
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

Pablichjenkov

11/17/2023, 9:05 AM
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

Joel Denke

11/17/2023, 11:20 AM
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

Pablichjenkov

11/17/2023, 12:58 PM
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

Joel Denke

11/17/2023, 1:00 PM
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

Pablichjenkov

11/17/2023, 1:00 PM
Oh I see, uff I know that feeling.
j

Joel Denke

11/17/2023, 1:01 PM
But yeah I need to refactor the entire structure it seems
p

Pablichjenkov

11/17/2023, 1:01 PM
I migrated from cocoapods time ago
j

Joel Denke

11/17/2023, 1:01 PM
This was a hack because well cocoapods sucks and cant use anything else for shared resources 🤣
p

Pablichjenkov

11/17/2023, 1:01 PM
So can't really tell much about it
I know yeah
j

Joel Denke

11/17/2023, 1:02 PM
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

Pablichjenkov

11/17/2023, 1:03 PM
I saw something about it in the latest dev release
But haven't played with it yet
j

Joel Denke

11/17/2023, 1:03 PM
Maybe I missed it in 1.5.0 release. Checked releasenotes.
Ideally want KMP share my Gradle module to iOS app automatic
p

Pablichjenkov

11/17/2023, 1:04 PM
Is 1.6.0-dev something
j

Joel Denke

11/17/2023, 1:04 PM
Dont want to expose anything to iOS.
Amper where are you ;)
p

Pablichjenkov

11/17/2023, 1:04 PM
Jeje
j

Joel Denke

11/17/2023, 1:04 PM
Also they deleted the iOS textfield without mention 😁
p

Pablichjenkov

11/17/2023, 1:05 PM
Oh I haven't noticed it
Now has a different name?
j

Joel Denke

11/17/2023, 1:06 PM
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

Pablichjenkov

11/17/2023, 1:06 PM
Very hacky at the moment yes
j

Joel Denke

11/17/2023, 1:06 PM
Did my own polyfill to solve it 🤣
😁 1
Praying for beta state soon 😁
p

Pablichjenkov

11/17/2023, 1:07 PM
KMP chatgpt plugin lol
😄 1
j

Joel Denke

11/17/2023, 1:07 PM
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

Pablichjenkov

11/17/2023, 1:09 PM
Yeah right!
j

Joel Denke

11/17/2023, 1:09 PM
But anyway need to get rid of my cocoapods. Any sample how using jetbrains resources without cocoapods?
p

Pablichjenkov

11/17/2023, 1:09 PM
I think the official template is not using it anymore
j

Joel Denke

11/17/2023, 1:10 PM
Which one is that 😁 So many random GitHub samples out there xD
p

Pablichjenkov

11/17/2023, 1:10 PM
There is a PR where Igor demin did the migration
Give me a second
j

Joel Denke

11/17/2023, 1:12 PM
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 :)
p

Pablichjenkov

11/17/2023, 1:32 PM
Yes that is the PR, sorry wasn't Igor but Alexey
j

Joel Denke

11/17/2023, 3:26 PM
3 Views