bmo
03/04/2021, 8:36 AMArtyom Degtyarev [JB]
03/04/2021, 1:30 PM:example
module. The other problem I see is that you define export(...)
over the framework, which is not being used by the CocoaPods plugin. To access the right one, I would recommend to get rid of the current framework{…}
block, and to specify those export as
targets.withType<KotlinNativeTarget>{
binaries.withType<org.jetbrains.kotlin.gradle.plugin.mpp.Framework>{
//Specify things here
}
}
bmo
03/04/2021, 2:37 PMios("ios") {
binaries {
framework("Example") {
// Specify things here
}
}
}
Artyom Degtyarev [JB]
03/04/2021, 2:52 PMAdds bothThis framework’s name will be set by theanddebug
frameworks as output binaries for all macOS, iOS, tvOS, and watchOS targets.release
frameworkName
option, and none of your options defined at the ios().binaries.framework
block will be applied.link<Debug|Release>Framework<targetName>
and add it to the Xcode - manually or using packForXcode
task, as the documentation and all wizards do
2. You use the CocoaPods plugin to set dependency on a pod, AND to deliver your framework to the Xcode project
Mixing those is not a good idea, this way one could confuse oneself easily.bmo
03/04/2021, 3:15 PMtargets.withType<KotlinNativeTarget>{
binaries.withType<org.jetbrains.kotlin.gradle.plugin.mpp.Framework>{
baseName = "Example"
export(project(":common")) {
isStatic = true
}
}
}
The import in Android Studio takes a very long time to finish (it's been running for 20 minutes) and the tasks which takes the longer seems to be :
:example:generateDummyFramework
:example:podImport
Also, I have changed `common`'s build.gradle.kts
to remove the cocoapods part and said that the binary is a staticLib
When I do a pod install
with only example
in my Podfile
, nothing changes. I still have classes generated in the framework which matches the interface in common
but no class from common
Finally, I realized I wasn't clear yesterday but the reason why I had common
as a cocoapods is because later, I want more than 1 module like example
and they all need to depend on the same common
(but I'll figure this part later)Artyom Degtyarev [JB]
03/05/2021, 11:53 AMisStatic
parameter makes sense only for a framework block. I’m not sure this syntax works correctly.
2. Have you tried adding transitiveExport = true
?
targets.withType<KotlinNativeTarget>{
binaries.withType<org.jetbrains.kotlin.gradle.plugin.mpp.Framework>{
baseName = "Example"
export(project(":common"))
isStatic = true
transitiveExport = true
}
}
bmo
03/05/2021, 1:49 PMHiresh Pillay
08/11/2022, 11:16 AM