I recently updated a KMP library to depend on Opus...
# kotlin-native
t
I recently updated a KMP library to depend on Opus via Cocoapods. I am occasionally getting link errors when it builds on Jenkins. It always builds successfully when I do the commands that we have in the Jenkins Pipeline on the terminal. Has anybody seen anything like this before? I also don't know how to continue since I don't have a Podfile that is in source. Most debugging solutions add stuff like ONLY_ACTIVE_ARCH, but I can't do that since the Podfile is generated each time.
r
You can pass
noPodspec()
in the cocoapods block to avoid the podspec getting regenerated if you're making edits. Alternatively, you can add custom properties via
extraSpecAttributes
which might let you configure the plugin to generate what you want rather than hand-editing it.
oh wait, you're issue is podfile generation, not podspec. My advice probably isn't helpful then
t
Thanks for the advice. I'll see if any of that helps. I guess there isn't a way to specify the Podfile so that it isn't regenerated each time?
r
You don't have to point gradle to the podfile. I usually don't. In that case you should be able to do whatever you want to it without the Kotlin build affecting it. But then gradle will no longer call
pod install
for you so you'll have to do that manually when needed.
t
I'm not pointing to a podfile right now. I just include this cocoapods section in my KMP shared module.
Copy code
cocoapods {
	version = "1.1.2"
	summary = "Mobile SDK"
	homepage = ""
	ios.deploymentTarget = "14.1"
	framework {
		baseName = "mobileSdk"
		isStatic = true
		transitiveExport = true
	}

	pod("OpusKit", version = "1.0.1")
}
It puts the generated podfile under build/cocoapods/synthetic. How would I switch to including a podfile in the same directory as my podspec?
r
oh I see, this is for the generated podfile it uses internally for dependencies, not the podfile you might be using at the app layer. In that case I'm again not sure. You can try to find the task that generates it and edit the file in a
doLast {}
block
but in that case you'll need to parse and edit it all manually
t
Yeah, it's challenging. 🙂
Thanks!