I'm working on a KMM project with CocoaPods dependencies. For some reason unknown to me, the iOS Deployment Target for each Pod target on which my project depends is being set to 8.0 each time I try to sync the project, but the range of supported deployment target versions is 9.0 to 14.5.99, so each time I try to sync the project, it fails on the shared:podBuild(PodName)Iphonesimulator task. I tried opening up the project in Xcode and changing the versions manually, but this does not work because the iOS Deployment Target is changed back to 8.0 each time I attempt to sync the project. What else can I do about this?
m
Matti MK
10/22/2021, 5:28 AM
Bump the targets in your Podfile
post_install
block:
Copy code
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $deploymentTarget
end
end
end
j
jimmyt
10/22/2021, 2:59 PM
Should this be in Project/iosApp/Podfile ? I tried placing it there, but I'm still running into the same issue.
m
Matti MK
10/22/2021, 3:02 PM
Yes
Matti MK
10/22/2021, 3:03 PM
I'm not sure what the Gradle command does that you are running though. I manually build the dependency and then run pod install to integrate with the iOS project
Matti MK
10/22/2021, 3:03 PM
What happens if you build, then run pod install, then launch the app with Xcode?
j
jimmyt
10/22/2021, 3:09 PM
Actually, I'm seeing that there is a Swift compiler error that is causing the build to fail, perhaps before the post_install changes can be applied. Let me try to fix that first, and I'll report back.