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

Error when install via Cocoapods. "Could not build Objective-C module 'DarklyEventSource' #193

Closed clehew closed 4 years ago

clehew commented 5 years ago

Describe the bug I am unable to use the Launch Darkly pod because when I try to build my project I see this:

error: 'DarklyEventSource/LDEventSource.h' file not found

import <DarklyEventSource/LDEventSource.h>

    ^
:0: error: could not build Objective-C module 'DarklyEventSource' :2:9: note: in file included from :2: #import "Headers/LaunchDarkly-Swift.h"

To fix this I have cleared derived data, removed all pods and reinstalled the pod as the only pod in my project. I cannot seem to find a way to get past this error.

To reproduce Just did a pod install.

Expected behavior Launch Darkly should be installed and my project should build.

Logs If applicable, add any log output related to your problem.

SDK version pod 'LaunchDarkly', '4.1.2'

Language version, developer tools Xcode 10.3 Swift 5

OS/platform iOS 10.0 is our deployment target

Additional context At first I assumed this was a random Cocoapods error, but after uninstalling the pods and reinstalling, I can't seem to fix this. Any insight would be helpful.

torchhound commented 5 years ago

Hi @clehew, are you upgrading from an older version of our SDK? Is there a version that did work correctly for you?

clehew commented 5 years ago

@torchhound -Since you asked, I tried to downgrade to 4.0.0 because originally it worked with that version, it doesn't work now unfortunately. This issue started showing up around the time when I upgraded to 4.1.2 and Xcode 10.3.

clehew commented 5 years ago

@torchhound we can close this. It was some kind of Cocoapods issue. I deleted my project, deleted derived data, re-cloned it and did pod install and now it works.

torchhound commented 5 years ago

Glad to hear it's working now!

clehew commented 4 years ago

HI @torchhound - I think this may need to be reopened. this has happened 5 or 6 times since we closed the ticket.

LD-error1 LD-error2 LD-error3

This is a swift project using cocoa pods built on Xcode 11.0. I'm not sure how to consistently recreate, but it often happens when I switch between branches in Git that have added to the podfile and branches that don't. I can get it to work by recloning the project from scratch. I've tried deleting derived data and even pod reintegrate and deleting workspace and the pod folder

torchhound commented 4 years ago

Hi @clehew sorry to hear this is happening again. I'll try and investigate but this sounds like it might be specific to your environment somehow.

clehew commented 4 years ago

@torchhound maybe so, best I can tell it may have something to do with the mix of Swift and Objective-C. I'm getting it almost everyday, I'll try and get some steps to recreate if possible.

gwhelanLD commented 4 years ago

As this issue hasn't had any recent activity, and the iOS SDK has moved to a new Swift EventSource implementation, I'm closing this issue.

Thanks for working with us on this issue, @gwhelanLD