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

Realm for iOS in Xcode 8 & Swift 3 #3932

Closed
dodomarocgenex opened this issue Aug 1, 2016 · 13 comments
Closed

Realm for iOS in Xcode 8 & Swift 3 #3932

dodomarocgenex opened this issue Aug 1, 2016 · 13 comments
Labels

Comments

@dodomarocgenex
Copy link

dodomarocgenex commented Aug 1, 2016

Goals

Use Realm 1.0.2 for a iOS Swift 3 project

Expected Results

Compile without errors or warnings

Actual Results

Compile error

ld: .../Products/Debug-iphonesimulator/RealmSwift/RealmSwift.framework/RealmSwift compiled with older version of Swift language (2.0) than previous files (3.0) for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Steps to Reproduce

Following the steps given here

  • Create an empty project
  • install Realm using Coacoapods :
pod 'Realm', git: 'https://github.com/realm/realm-cocoa.git', branch: 'master', :submodules => true

pod 'RealmSwift', git: 'https://github.com/realm/realm-cocoa.git', branch: 'master', :submodules => true
  • Add RLMSupport.swift into the File Navigator of the Xcode project

Version of Realm and Tooling

Realm version: 1.0.2

Xcode version: 8 beta 3

iOS version: 9.3.3

Dependency manager + version: Coacoapods 1.0.1

@austinzheng
Copy link
Contributor

Hello,

Thanks for getting in touch with us.

To use Realm with Swift 3, you need to explicitly set the Use Legacy Swift Language Version flag on the CocoaPod target. This can be done by clicking on the Pods project, clicking on the RealmSwift target, going to the 'Build Settings' tab, and changing the flag to Yes. (Note that you might have set this flag on your actual project's target; you also have to set it separately on the Pod target. This is no longer necessary if you install the latest beta version of CocoaPods.)

Hope that helps.

@dodomarocgenex
Copy link
Author

Thank you for the quick response,
I've already enabled the Use Legacy Swift Language flag in the RealmSwift target, and the error is still there.
And just to make sure, I've deleted all derived data and restarted with an empty project.

@austinzheng
Copy link
Contributor

Sorry that didn't work! Here's another thing to try.

Can you go to Xcode --> Preferences --> Locations tab and make sure the Xcode 8 (not Xcode 7) command line tools are selected?

@dodomarocgenex
Copy link
Author

Command line tools were set to Xcode 7.3.1. Setting them to Xcode 8 had no effect.

@austinzheng
Copy link
Contributor

Would you be willing to send over a copy of the empty project that you say is not working? You can create an attachment and link it, or send it directly to help@realm.io.

@dodomarocgenex
Copy link
Author

@austinzheng thank you for the support, I've managed to use Realm with Cocoapods and Xcode beta 4

@anthonycastelli
Copy link

How did you get this resolved? I am having the same issue

@dodomarocgenex
Copy link
Author

What version of Xcode are you using? The beta 5 has been released today

@anthonycastelli
Copy link

@dodomaroc86 I was using Beta 4, downloading beta 5 now and will test that.

@anthonycastelli
Copy link

Same issue on Beta 5

@bdash
Copy link
Contributor

bdash commented Aug 9, 2016

@anthonycastelli, it's probably best to file a new issue with details of the problem you're seeing so we can help you.

@anthonycastelli
Copy link

@bdash Thats what I plan on doing soon as I get home. I thought maybe @dodomaroc86 had a few ideas since he got his working.

@dodomarocgenex
Copy link
Author

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants