Building an iOS App using Realm with Xcode 7.3 and Swift 2.2.
Build should succeed
Build with Realm for Swift 2.1 does not work as it was compiled in earlier version
Custom Realm build with Swift 2.2 (using sh build.sh build) crashes with dyld_fatal error
dyld`_dyld_start:
0x7fff6dc0d000 <+0>: popq %rdi
0x7fff6dc0d001 <+1>: pushq $0x0
0x7fff6dc0d003 <+3>: movq %rsp, %rbp
0x7fff6dc0d006 <+6>: andq $-0x10, %rsp
0x7fff6dc0d00a <+10>: subq $0x10, %rsp
0x7fff6dc0d00e <+14>: movl 0x8(%rbp), %esi
0x7fff6dc0d011 <+17>: leaq 0x10(%rbp), %rdx
0x7fff6dc0d015 <+21>: movq 0x38abc(%rip), %r8 ; _dyld_start_static
0x7fff6dc0d01c <+28>: leaq -0x23(%rip), %rcx ; <+0>
0x7fff6dc0d023 <+35>: subq %r8, %rcx
0x7fff6dc0d026 <+38>: leaq -0x102d(%rip), %r8
0x7fff6dc0d02d <+45>: leaq -0x8(%rbp), %r9
0x7fff6dc0d031 <+49>: callq 0x7fff6dc0d076 ; dyldbootstrap::start(macho_header const_, int, char const__, long, macho_header const_, unsigned long*)
-> 0x7fff6dc0d036 <+54>: movq -0x8(%rbp), %rdi
0x7fff6dc0d03a <+58>: cmpq $0x0, %rdi
0x7fff6dc0d03e <+62>: jne 0x7fff6dc0d050 ; <+80>
0x7fff6dc0d040 <+64>: movq %rbp, %rsp
0x7fff6dc0d043 <+67>: addq $0x8, %rsp
0x7fff6dc0d047 <+71>: movq $0x0, %rbp
0x7fff6dc0d04e <+78>: jmpq *%rax
0x7fff6dc0d050 <+80>: addq $0x10, %rsp
0x7fff6dc0d054 <+84>: pushq %rdi
0x7fff6dc0d055 <+85>: movq 0x8(%rbp), %rdi
0x7fff6dc0d059 <+89>: leaq 0x10(%rbp), %rsi
0x7fff6dc0d05d <+93>: leaq 0x8(%rsi,%rdi,8), %rdx
0x7fff6dc0d062 <+98>: movq %rdx, %rcx
0x7fff6dc0d065 <+101>: movq (%rcx), %r8
0x7fff6dc0d068 <+104>: addq $0x8, %rcx
0x7fff6dc0d06c <+108>: testq %r8, %r8
0x7fff6dc0d06f <+111>: jne 0x7fff6dc0d065 ; <+101>
0x7fff6dc0d071 <+113>: jmpq *%rax
0x7fff6dc0d073 <+115>: nop
Update Xcode to Version 7.3
Create new Realm build from master with commit #55ba2e0
Import Realm.framework and RealmSwift.framework as described in manual on Realm.io
Try to run app in Simulator or on device
No Code sample
OS X El Capitan 10.11.3
Xcode Version 7.3
Realm built from branch master with latest commit #55ba2e0 using command "sh build.sh build"
Tested in iOS Simulator and on iPod Touch Device
Any help would be greatly appreciated
Apple is quite clear about Swift's binary compatibility guarantees. You should not mix Swift code compiled with different versions of Swift, as there is no guarantee for binary compatibility. We're in the process of upgrading our CI infrastructure to use El Capitan and Xcode 7.3 and will be cutting new binary releases when that process is complete. Until then, to use Realm Swift with Xcode 7.3, please build it from source using CocoaPods, Carthage with carthage update --no-use-binaries or Xcode subprojects.
edit: updated Carthage command. Thanks @kishikawakatsumi!
@jpsim @tikiatua carthage build doesn't support --no-use-binaries argument.
Use carthage update --no-use-binaries or carthage bootstrap --no-use-binaries instead.
Many thanks for your awesome and very quick help. The issue was actually due to the fact, that the library was no longer included as embedded binary (otool -L helped me discover the issue)
Using the build process without carthage or cocoa-poad does work as expected.
How would we go bout having Cocoapods build from source rather than using the binaries?
We have just released Realm Swift v0.98.6, built with Xcode 7.3, to address this issue.
Most helpful comment
@jpsim @tikiatua
carthage builddoesn't support--no-use-binariesargument.Use
carthage update --no-use-binariesorcarthage bootstrap --no-use-binariesinstead.