Has anyone been able to "nest" ios frameworks crea...
# compose-ios
j
Has anyone been able to "nest" ios frameworks created by kmp? I'm working on a library, and kmp creates a "framework". Then, I go to my app, where I want to use the framework, and I attempt to build my app in xcode, and get "no such module". I've added the framwork to xcode, and xcode editor can find it, I can click through and see it, but it can't be found when I build. With Android, it just works, I have my lib in commonMain deps, and it just gets picked up.
d
Are you adding a reference to the library file in your Xcode project?
j
ya, I've tried adding path to framework search path. It's in the frameworks section in xcode, and xcode recognizes it. It's also in compile sources, and in "embed frameworks" in build phases.
I've added it to here in a lot of different ways
Copy code
iosArm64 {
        binaries.framework {
            baseName = "ComposeApp"
            isStatic = true
like
Copy code
linkerOpts += listOf(
                "-F", test,
                "-framework", "Test",
                "-rpath", test
            )
d
Oh, you're doing a static library. It shouldn't need to be in the compile sources phase, as the library should already have been built using gradle.
You're adding the linker options in Xcode?
j
I have the path in framework search paths
d
OK, I was confused by the
linkerOpts
section you posted. So, you build the static library using gradle, and then you add a reference to it in your Xcode project and try a build in Xcode, correct?
Are you copying the library into your Xcode project? Is this a monorepo where you iOS, Android, and KMP code are together?
j
yes, it's a multimodule gradle project, I have a "library", and an "app". I want to use the library in my app (both ios and android), and I want others to be able to use the ios lib in any ios project. Ya, so with the ios framework using the Compile Kotlin Framework build step.
d
Hmmm. Let me take a look at a couple of things. I'll try to get back to you tonight, if not tomorrow.
j
thanks so much for your help 🙏
for me, the issue was that i had been including some dependencies with "implementation" where I needed "api", so when I exported the framework with the child module, it included the classes I needed.