Sterling Albury
07/29/2020, 2:07 AMJetBrains/kotlin-native
project using the kotlin-native-xcode-11-4-workaround
library. I modified the kotlin-library
project to have two modules, both of which are using the cocoapods plugin.
I saw this thread where @Kris Wong found a project that uses a third module to aggregate things using the packForXCode
task pattern, and I’ve tried to do basically the same thing but haven’t been successful getting that to work.
I’ve also played with creating a fatFramework in a third module but I’m not sure I’m doing it correctly. I feel like from everything that I’ve read, this might be the best way to go.
Has anyone aggregated two or more modules with cocoapods frameworks for ios targets? Would having a module that creates a fatFramework from other modules be a way to go? Should I be using the export
function to export the module and the module dependecies in my ‘aggregate’ module, and then create the fatFramework?
The project I’d like get to eventually would have a bunch of shared modules, some using cocoapod frameworks, some not, so I’m trying to find a good way to keep expanding on this. Thanks.kpgalligan
07/29/2020, 12:08 PMKevin S
07/29/2020, 4:04 PMexport
in the plug-in to allow us to have an aggregate, or top level, module that exports the submodules. So you’re on the right track with your export
idea, and while it’s not available in the base cocoapods plug-in I believe you can use it with packForXcode
. You have to first reference the submodule with an api
call. i.e. api(project(":submodule"))
and then export the module
I also have a sample of how the export cocoapods process works here https://github.com/KevinSchildhorn/MultiKMPModulesSample
Also worth noting that the aggregate, or top level, module is the best approach at the moment, as there’s some issues with including multiple kmp frameworks right now. Here’s some info on that. https://dev.to/touchlab/multiple-kotlin-frameworks-in-an-application-34e9building universal frameworks
https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#building-final-native-binariesSterling Albury
07/29/2020, 6:06 PMpod("AFNetworking", "~> 3.2.0")
in the cocoapodsext section? I'm currently getting a 'module ‘AFNetworking' not found' error. I noticed in Kevin S's sample project that there are no pods being imported, so I just wanted to double check that this is still possible to have.
Now that I think about it that workaround lib might not work with the plugin fork. I'll clone the sample project and play with that (should have done that before posting)kpgalligan
07/29/2020, 10:40 PMpod
statements don’t work. They only work with isStatic = true
, or just leave isStatic
off entirely. That’s one of the issues we have to resolve.Sterling Albury
07/30/2020, 12:23 AMiStatic
variable didn’t seem to help. I think isStatic
needs to be false for dynamic frameworks. This kotlin-native-xcode-11-4-workaround
library seems to act weird when there’s more than one module, so I think there’s something going on with the compatibility with the forked plugin. I’ll keep playing around to see if I can get something working.kpgalligan
07/30/2020, 11:48 PM