https://kotlinlang.org logo
#compose-ios
Title
# compose-ios
a

Angga Ardinata

10/10/2023, 9:46 PM
HI, does anyone know why xcode cant resolve this ? when i build it from android studio it's just fine
p

Pablichjenkov

10/10/2023, 9:55 PM
Some times xCode takes its time. When you run the build, does it fails?
a

Angga Ardinata

10/10/2023, 10:54 PM
yes it is failed .. i noticed that if you delete Pods folder .. then rebuild the project or clean then run for ios Target .. xcode suddenly can resolve all the reference .. but again if i re run the code from android studio with some changes .. xcode cant resolve the reference again
if i take a look inside ComposeApp .. it’s empty
p

Pablichjenkov

10/10/2023, 10:57 PM
Are you using cocoapods? Run the podAssembleFramework task
a

Angga Ardinata

10/10/2023, 10:58 PM
@Pablichjenkov.. another question related to this .. if i remove all Cocoapods reference .. and use something like this .. how can i add specific ios dependencies for example i need Lokalise for my project .. for now i use pod(“Lokalise”, “1.10.5") inside cocoapod
p

Pablichjenkov

10/10/2023, 11:09 PM
This is the official documentation of how to add dependencies. https://kotlinlang.org/docs/multiplatform-mobile-ios-dependencies.html Tbh cocoapods makes it easy the fact that it generates the objective-c/kotlin bindings automagically. As you can read in the docs using a plain framework you gotta write the file that generates the headers and is more work.
I was using cocoapods before but I discovered that I prefer using plain interfaces to bridge Kotlin and Swift. Basically an interface is a header file at a high scale. Whatever code that I do in swift I wrap it into an interface and send it to Compose/Kotlin land. Haven't tried but you can import a swift library and use it in swift too. I don't see any technical limitations
a

Angga Ardinata

10/10/2023, 11:14 PM
do you have any sample or article for what you said please ? im still new to ios ..
p

Pablichjenkov

10/10/2023, 11:14 PM
I can give you some links later. A bit busy atm
a

Angga Ardinata

10/10/2023, 11:15 PM
Cannot locate tasks that match ':composeApp:podAssembleFramework' as task 'podAssembleFramework' not found in project ':composeApp'.
got this error when podAssembleFramework
im using cocoapods
p

Pablichjenkov

10/10/2023, 11:17 PM
Is that the right name? I don't recall but I believe is different. Sorry I didn't post the exact name just a clue. Go to your gradle panel and try the tasks under shared/cocoapods
a

Angga Ardinata

10/10/2023, 11:18 PM
Heres the list
p

Pablichjenkov

10/10/2023, 11:20 PM
Yes
podPublishDebugXCFramework
should work
a

Angga Ardinata

10/10/2023, 11:22 PM
okay thanks .. ill try that
Still can resolve the main issue
p

Pablichjenkov

10/11/2023, 12:27 AM
Are you exporting LifecycleHelper.kt class. You need a public file in
iosMain
sourcet that expose your class as a public input/ output parameter of a function.
5 Views