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

Closed
SweatSzemis opened this issue Oct 9, 2024 · 5 comments
Closed

defined(__OBJC__) returning false #368

SweatSzemis opened this issue Oct 9, 2024 · 5 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.

@bsneed
Copy link
Contributor

bsneed commented Nov 22, 2024

My apologies @SweatSzemis, I missed your response. You've likely solved it by now, if so I'm curious what the issue was. I didn't really have any guesses on my end.

@bsneed bsneed closed this as completed Nov 22, 2024
@bsneed
Copy link
Contributor

bsneed commented Nov 22, 2024

If you're still having issues, feel free to reopen this ticket.

@SweatSzemis
Copy link
Author

I've found that the project will compile on a test device. So this has unblocked our progress.
However, in simulator the unsupported Swift architecture error occurs so until resolved we can't use the simulator anymore.

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