launchdarkly / ios-client-sdk

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

LDSwiftSourceEvent link issue #257

Closed kinglezhuang closed 2 years ago

kinglezhuang commented 2 years ago

I open workspace and build ios framework. Then embedded the LanuchDarkly.framework & LDSwiftEventSource.framework into our project. It show below error: Class _TtC18LDSwiftEventSource11EventParser is implemented in both /Users/rcadmin/jenkins-slave/workspace/CommonCI-mThor-Core-Auto-Generate/RingCentral-Core/build/Build/Products/Debug-iphonesimulator/core-test.xctest/Frameworks/LDSwiftEventSource.framework/LDSwiftEventSource (0x170ba2498) and /Users/rcadmin/jenkins-slave/workspace/CommonCI-mThor-Core-Auto-Generate/RingCentral-Core/build/Build/Products/Debug-iphonesimulator/core-test.xctest/Frameworks/LaunchDarkly.framework/LaunchDarkly (0x1708fa870). One of the two will be used. Which one is undefined.

I found EventParser symbol exist in LanuchDarkly.framework, not reasonable because it just belongs to LDSwiftEventSource.framework.

I open project & found the dependency is framework, but link by using static in project build phase tab. Incorrect, right?

louis-launchdarkly commented 2 years ago

Hello @kinglezhuang, Apologies for the delay and thank you for waiting. From your error, it seems that the linker is complaining there are multiple implementations of LDSwiftEventSource. Because the iOS SDK already listed LDSwiftEventSource as a [dependency] (https://github.com/launchdarkly/ios-client-sdk/blob/v5/Package.swift#L22), have you tried to only embed LaunchDarkly.framework?

https://github.com/launchdarkly/hello-ios is a helpful reference on how to use the iOS SDK.

If the suggestions above do not resolve your issue, please contact our support via https://support.launchdarkly.com/hc/en-us

louis-launchdarkly commented 2 years ago

No more comments from the requester.