launchdarkly / ios-client-sdk

LaunchDarkly Client-side SDK for iOS (Swift and Obj-C)
https://docs.launchdarkly.com/sdk/client-side/ios
Other
70 stars 84 forks source link

Carthage build error due to deployment target mismatch #280

Closed pepas-everly closed 1 year ago

pepas-everly commented 2 years ago

EDIT: This issue is specifically for Xcode 14.

At some point, one of Launch Darkly's dependencies (LDSwiftEventSource) bumped its deployment target to 11.0, but the iOS SDK's deployment target is still set to 10.0:

Screen Shot 2022-09-12 at 4 04 17 PM

This causes Carthage to attempt to build everything using the 10.0 deployment target, which of course causes LDSwiftEventSource to fail to build:

.../FlagSynchronizer.swift:3:8: error: compiling for iOS 10.0, but module 'LDSwiftEventSource' has a minimum deployment target of iOS 11.0

To fix this, please bump the iOS SDK's deployment target to 11.0.

While waiting for this upstream fix, current Carthage users can use the following work-around:

carthage update --no-build

# Fix LaunchDarkly by bumping its deployment target.
cd Carthage/Checkouts/ios-client-sdk
    sed -I '' 's/IPHONEOS_DEPLOYMENT_TARGET = 10.0;/IPHONEOS_DEPLOYMENT_TARGET = 11.0;/'  LaunchDarkly.xcodeproj/project.pbxproj
cd - >/dev/null

carthage build --use-xcframeworks --platform iOS --no-use-binaries --cache-builds
keelerm84 commented 2 years ago

Thank you for filing this report. I'm unclear on when this deployment target might have been modified. Looking at the swift eventsource repo, we are targeting iOS v10 as seen here.

I setup a new project locally and was able to build without issue and without a workaround. Are you able to setup a minimal reproducible test case?

pepas-everly commented 2 years ago

I setup a new project locally and was able to build without issue and without a workaround.

Try again with Xcode 14.

You should see this error immediately:

Screen Shot 2022-09-13 at 10 54 00 AM

Steps to reproduce the above error:

pepas-everly commented 2 years ago

I just realized I hadn't actually mentioned Xcode 14 anywhere in the original post. Sorry for the confusion. I'll update it.

pepas-everly commented 2 years ago

we are targeting iOS v10

Also, 11.0 appears to be the minimum deployment target for Xcode 14.

keelerm84 commented 1 year ago

We have published v7.0.0. This version drops support for iOS v10, allowing developers to use Xcode 14. Thank you for your patience while we worked on a fix for this!