Derek Ellis
10/18/2020, 6:58 PMcocoapods {
summary = "mapbox framework"
homepage = "<https://github.com/cuhacking/atlas>"
frameworkName = "MapStuff"
ios.deploymentTarget = Versions.ios
pod("Mapbox-iOS-SDK", "~> 5.9", moduleName = "Mapbox")
}
this module isn't imported as a framework^, it's just more convenient to manage pod dependencies with the plugin
and then we have another module called "common" configured like so:
cocoapods {
summary = "mapbox framework"
homepage = "<https://github.com/cuhacking/atlas>"
podfile = project.file("../ios/Podfile")
frameworkName = "Common"
ios.deploymentTarget = Versions.ios
}
The Common framework depends on the first module^ and is then included as a dependency for our iOS app.
pod 'common', :path => '../common'
Everything builds normally until trying to build in Xcode where it fails with a "module 'Mapbox' not found" on the cinterop step. Tried just about everything at this point, and I saw a similar-looking issue about subspecs but AFAIK this isn't related since the Mapbox-iOS-SDK pod can be included and I have been able to before.Derek Ellis
10/18/2020, 7:38 PMDerek Ellis
10/18/2020, 7:39 PMilya.matveev
10/19/2020, 11:59 AMMapbox-iOS-SDK
to a podspec file generated for the common
module. You can automate this action by editing the podspec
task. To do this, add this snippet to your build.gradle.kts in the common
module:
tasks["podspec"].doLast {
val podspec = file("${project.name.replace("-", "_")}.podspec")
val podspecContent = podspec.readLines().toMutableList()
val endIndex = podspecContent.indexOfLast { it == "end" }
podspecContent.add(endIndex, " spec.dependency 'Mapbox-iOS-SDK', '~> 5.9'")
podspec.writeText(podspecContent.joinToString(separator = "\n"))
}