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

Any stable version for Swift 3? #4073

Closed
Luccifer opened this issue Sep 9, 2016 · 10 comments
Closed

Any stable version for Swift 3? #4073

Luccifer opened this issue Sep 9, 2016 · 10 comments
Labels

Comments

@Luccifer
Copy link

Luccifer commented Sep 9, 2016

Hello! Wondering about RealmSwift with support and the full power of Swift 3d generation, but:

I tried to use Pods with
pod 'RealmSwift', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'jp-xcode8-ci'
and failed on installing with output:

[!] /bin/bash -c
set -e
sh build.sh cocoapods-setup

core is not a symlink. Deleting...
Downloading dependency: core 1.5.0

ERROR: One of Realm's submodules is missing!

If you're using Realm and/or RealmSwift from a git branch, please add 'submodules: true' to
their entries in your Podfile.

Realm version: Latest

Xcode version: 8.0 (8A218a)

iOS/ version: 9.1 +

Dependency manager + version: CocoaPods stable version

@steveatinfincia
Copy link

Add the submodules argument, like this:

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

@bdash
Copy link
Contributor

bdash commented Sep 9, 2016

As @steveatinfincia mentioned, you need to let CocoaPods know that Realm's Git repository uses submodules. This will let you build Realm Swift from our master branch.

To answer the question in your title: we intend to make a release next week that includes support for both Swift 2.3 and Swift 3.0. Until that release we may make some small changes to our Swift 3 API to better fit with the changes to the Swift naming guidelines.

@bdash bdash closed this as completed Sep 9, 2016
@puttin
Copy link

puttin commented Sep 10, 2016

This is what I get:

$ bundle exec pod install --verbose

  Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-****`: (``)

Fetching external sources
-> Pre-downloading: `RealmSwift` from `https://github.com/realm/realm-cocoa.git`, branch `master`, submodules `true`
  $ /usr/local/bin/git ls-remote https://github.com/realm/realm-cocoa.git master
  742e530446e7c3b74abdf902b9109ab8f1086753      refs/heads/master
 > Git download
 > Git download
     $ /usr/local/bin/git clone https://github.com/realm/realm-cocoa.git
     /var/folders/kj/9rzfzmjx1k3fknfx73mbmq_m0000gn/T/d20160910-66310-1lt5q7s --template=
     Cloning into '/var/folders/kj/9rzfzmjx1k3fknfx73mbmq_m0000gn/T/d20160910-66310-1lt5q7s'...
     $ /usr/local/bin/git submodule update --init --recursive
     Submodule 'Realm/ObjectStore' (https://github.com/realm/realm-object-store.git) registered for path 'Realm/ObjectStore'
     Cloning into '/private/var/folders/kj/9rzfzmjx1k3fknfx73mbmq_m0000gn/T/d20160910-66310-1lt5q7s/Realm/ObjectStore'...
     Submodule path 'Realm/ObjectStore': checked out '7922710805950c353f00c4ba5146e2ff98aa8aa9'
     Submodule 'external/catch' (https://github.com/philsquared/Catch) registered for path 'Realm/ObjectStore/external/catch'
     Submodule 'external/pegtl' (https://github.com/ColinH/PEGTL) registered for path 'Realm/ObjectStore/external/pegtl'
     Cloning into '/private/var/folders/kj/9rzfzmjx1k3fknfx73mbmq_m0000gn/T/d20160910-66310-1lt5q7s/Realm/ObjectStore/external/catch'...
     Cloning into '/private/var/folders/kj/9rzfzmjx1k3fknfx73mbmq_m0000gn/T/d20160910-66310-1lt5q7s/Realm/ObjectStore/external/pegtl'...
     Submodule path 'Realm/ObjectStore/external/catch': checked out 'f294c9847272b1b92c5119a6f711e57113b5f231'
     Submodule path 'Realm/ObjectStore/external/pegtl': checked out '3c4128a7e7e1288eb746418ea60c41477358f26a'
   $ /usr/local/bin/git checkout --quiet 742e530446e7c3b74abdf902b9109ab8f1086753
   $ /usr/local/bin/git submodule update --init --recursive
 > Running prepare command
   $ /bin/bash -c  set -e sh build.sh cocoapods-setup
[!] /bin/bash -c
set -e
sh build.sh cocoapods-setup



/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/executable.rb:69:in `execute_command'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/executable.rb:27:in `block in executable'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer/pod_source_preparer.rb:66:in `block (2 levels) in run_prepare_command'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer/pod_source_preparer.rb:60:in `chdir'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer/pod_source_preparer.rb:60:in `block in run_prepare_command'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/user_interface.rb:64:in `section'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer/pod_source_preparer.rb:59:in `run_prepare_command'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer/pod_source_preparer.rb:37:in `prepare!'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/downloader/cache.rb:202:in `copy_and_clean'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/downloader/cache.rb:159:in `block (2 levels) in uncached_pod'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/downloader/cache.rb:157:in `each'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/downloader/cache.rb:157:in `block in uncached_pod'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/downloader/cache.rb:181:in `call'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/downloader/cache.rb:181:in `in_tmpdir'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/downloader/cache.rb:153:in `uncached_pod'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/downloader/cache.rb:33:in `download_pod'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/downloader.rb:42:in `download'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/external_sources/abstract_external_source.rb:114:in `block in pre_download'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/user_interface.rb:85:in `titled_section'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/external_sources/abstract_external_source.rb:112:in `pre_download'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/external_sources/downloader_source.rb:13:in `fetch'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer/analyzer.rb:609:in `fetch_external_source'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer/analyzer.rb:585:in `block (2 levels) in fetch_external_sources'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer/analyzer.rb:584:in `each'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer/analyzer.rb:584:in `block in fetch_external_sources'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/user_interface.rb:64:in `section'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer/analyzer.rb:583:in `fetch_external_sources'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer/analyzer.rb:73:in `analyze'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer.rb:236:in `analyze'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer.rb:150:in `block in resolve_dependencies'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/user_interface.rb:64:in `section'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer.rb:149:in `resolve_dependencies'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/installer.rb:110:in `install!'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/command/install.rb:37:in `run'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/claide-1.0.0/lib/claide/command.rb:334:in `run'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/lib/cocoapods/command.rb:50:in `run'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.1.0.beta.2/bin/pod:55:in `<top (required)>'
/Users/****/.rbenv/versions/2.2.1/bin/pod:23:in `load'
/Users/****/.rbenv/versions/2.2.1/bin/pod:23:in `<top (required)>'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:63:in `load'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:63:in `kernel_load'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:24:in `run'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/cli.rb:304:in `exec'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/cli.rb:11:in `start'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/exe/bundle:27:in `block in <top (required)>'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/friendly_errors.rb:98:in `with_friendly_errors'
/Users/****/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/exe/bundle:19:in `<top (required)>'
/Users/****/.rbenv/versions/2.2.1/bin/bundle:23:in `load'
/Users/****/.rbenv/versions/2.2.1/bin/bundle:23:in `<main>'

Podfile

platform :ios, '10.0'

target '****' do
  use_frameworks!

  pod 'RealmSwift', git: 'https://github.com/realm/realm-cocoa.git', branch: 'master', submodules: true
end

And Xcodeproj from the master for Xcode 8 object version

Gemfile

gem 'cocoapods', '1.1.0.beta.2'
gem 'xcodeproj', :git => 'https://github.com/CocoaPods/Xcodeproj.git'

@bitomule
Copy link

I've followed the steps adding bot pods with master branch and submodules and I get these errors:

/MyProject/Pods/RealmSwift/RealmSwift/Realm.swift:478:46: @escaping attribute only applies to function types
/MyProject/Pods/RealmSwift/RealmSwift/Migration.swift:180:57: @escaping attribute only applies to function types

Any idea on how to fix it?. When is the "real" version released? Monday?

@bdash
Copy link
Contributor

bdash commented Sep 10, 2016

@puttin, you must explicitly specify both Realm and RealmSwift as dependencies when using a version of RealmSwift from Git. If you don't then CocoaPods will attempt to satisfy the Realm dependency with the most recent Realm release, which isn't necessarily compatible with RealmSwift from master:

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

@bitomule, are you using the Xcode 8 GM seed build (8A218a)? We made changes on master to be compatible with it earlier this week, which quite likely broke support for the earlier beta versions of Xcode 8. If you're not using the GM seed, please update and try again. If you are using it, please file a new issue with more details about what you're doing to see this.

@puttin
Copy link

puttin commented Sep 10, 2016

@bdash It turns out my fault. I delete Xcode 8 beta 6 this morning but forget to update xcode-select to GM version.

@bitomule
Copy link

@bdash thanks! using GM worked.

@scotteg
Copy link

scotteg commented Oct 17, 2016

In order to get Swift 3 versions of Realm and RealmSwift, I had to explicitly target master, set submodules to true, and include a post_install hook to set the Swift version:

use_frameworks!

target 'TARGET_NAME' do
    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

    post_install do |installer|
        installer.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '3.0'
            end
        end
    end
end

@arshadsk5
Copy link

Hello ,
i wanted to use realm swift framework for my swift 3 project, can any one please let me know which version to be used.

@bdash
Copy link
Contributor

bdash commented Nov 16, 2017

@arshadsk5, please don't comment on old, closed issues. File a new issue, or ask your question on Stack Overflow.

@realm realm locked and limited conversation to collaborators Nov 16, 2017
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

7 participants