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

Artem Bezlyubchenko

03/17/2022, 10:51 AM
Hello guys, I started to explore KMM + moko-template and I’m stacked trying to add cocoapods library to a feature module. May anyone help me or point to the documentation, please? What I’m trying to do: I added `id("dev.icerock.mobile.multiplatform.cocoapods")`to
:mpp-library:feature:auth#build.gradle.kts
Also I added
Copy code
cocoaPods {
    pod("Auth0")
}
to
:mpp-library:feature:auth#build.gradle.kts
. I tried to add
pod 'Auth0', '~> 1.39'
to Podfile as well. I did a
pod install
and trying to run the build. The error I receive is
ld: framework not found Auth0
a

alex009

03/18/2022, 1:54 AM
i think your error showed in compilation task of
mpp-library
. in this case you should add into
mpp-library
build.gradle:
Copy code
pod("Auth0", onlyLink = true)
to tell compiler that link with native binary required. https://gitlab.icerockdev.com/scl/boilerplate/mobile-moko-boilerplate/-/blob/master/mpp-library/build.gradle.kts#L79 here example. https://github.com/icerockdev/moko-crash-reporting/blob/37150635eb938930d9ab7626880dd65f6a131e9e/crash-reporting-crashlytics/build.gradle.kts#L24 here library add cocoapods dependency and when we use library (like you use feature-auth) we should add pod into gradle project that will compiled into framework
a

Artem Bezlyubchenko

03/18/2022, 9:53 AM
Thank you! for the answer and for the KMM growth)
22 Views