Realm-cocoa: Trying to get Realm to work with Xcode 9 Beta 1

Created on 12 Jun 2017  路  5Comments  路  Source: realm/realm-cocoa

Goals

I'm trying to get Realm ( v2.8.0) to work with Xcode 9 Beta 1. I've tried using Cocoapods and building Realm myself using the sh build.sh build but both solutions lead me to the error:

./scripts/swift-version.sh: line 59: [: =: unary operator expected

Expected Results

Realm to should work with Xcode 9 Beta 1

Actual Results

The current version of Realm does not work with Xcode 9 Beta 1

Steps to Reproduce

Building manually:

  1. Tried downloading the most recent version of Realm from the master branch and build it with sh build.sh build. (I'm aware that the prerequisites require me to have Xcode 8.x to build, I'm looking for a way to get Realm to work with Xcode 9 itself)

Cocoapods:

  1. Create a new project
  2. Try installing Realm with the default instructions of a pod install

## Code Sample
-

Version of Realm and Tooling


Realm framework version: v2.8.0 ( Manually building: Latest commit 217fb6d)
Realm Object Server version: -

Xcode version: v9.0 (Beta 1)

iOS/OSX version: macOS v10.12.5 (16F73)

Dependency manager + version: cocoapods-1.2.1

T-Help

Most helpful comment

I was able to install no problem through cocoa pods:

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'] = '4.0'
          end
      end
end

However, i did notice the compiler segfault: https://github.com/realm/realm-cocoa/issues/5019 when using LinkedObjects but this is a bug in the Swift compiler it should not be possible to make the compiler crash.

All 5 comments

Can you please share the output of which sh?

mayur (master *+) realm-cocoa-master $ which sh
/bin/sh

I was able to install no problem through cocoa pods:

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'] = '4.0'
          end
      end
end

However, i did notice the compiler segfault: https://github.com/realm/realm-cocoa/issues/5019 when using LinkedObjects but this is a bug in the Swift compiler it should not be possible to make the compiler crash.

@hishnash Thanks for your response. I got Realm to work with a basic test app.

Also, combined with the post_install do |installer| snippet and the recent Realm 2.8.1 release, I successfully got Realm working with one of my projects.
(Another project still won't work but this issue is resolved.)

I am using Carthage and still need assistance getting Realm Swift 2.8.1 to work in my Xcode 9 project.

Was this page helpful?
0 / 5 - 0 ratings