Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defined(__OBJC__) returning false #368

Open
SweatSzemis opened this issue Oct 9, 2024 · 2 comments
Open

defined(__OBJC__) returning false #368

SweatSzemis opened this issue Oct 9, 2024 · 2 comments
Assignees
Labels

Comments

@SweatSzemis
Copy link

Describe the bug
I'm attempting to use the latest Segment Swift Packing in my Objective C project,
I've added it my project using Swift package Manager.

In the Segment-Swift.h file going straight to the unsupported Swift architecture error.
Any guidance would be appreciated.

#if defined(__OBJC__)
OBJECTIVE-C CODE
#endif
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
#if defined(__cplusplus)
#endif
#pragma clang diagnostic pop
#endif

#else
#error unsupported Swift architecture
#endif

Expected behavior
Able to import Segment successfully

@import Segment;
*Screenshots
Screenshot 2024-10-09 at 4 13 19 pm
*

Platform (please complete the following information):

  • Library Version in use: 1.6.2
  • Platform being tested: [e.g. iOS]
@bsneed
Copy link
Contributor

bsneed commented Oct 21, 2024

Have you tried the Objc Example here? https://github.com/segmentio/analytics-swift/tree/main/Examples/apps/ObjCExample

It builds and seems to work fine. Seems likely something maybe in your project setup? Lemme know if this works for you.

@SweatSzemis
Copy link
Author

Thank you for the response. I figured the issue is most likely a project setup issue. However I am having trouble nailing it down. Do you have any suggestion about what to look for potentially.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants