we are actually upgrading to swift4 in xcode 9. when i tried to build the project it was reporting an error like "no viable overloaded '='". When i just goolge'd it. found like realm version 2.8.1 supports the xcode 9. but i am using 3.0.0-rc1 realm version.so wont it support xcode 9. Please correct me if i am deviating from the actual issue.
Realm framework version: 3.0.0-rc1
Realm Object Server version: ?
Xcode version: 9
iOS/OSX version: 10.12.6
Dependency manager + version: ?
@UmaRajesh Since version 2.8.1 or later (includes 3.0.0), Xcode 9 and Swift 4 are supported. Where does the error happen? Please tell us the details.
while i move my project to xcode 9 and build it . i am facing that issue. mainly in object.cpp file the error is reported for m_notifier = std::make_shared<_impl::ObjectNotifier>(m_row, m_realm); line of code
NotificationToken Object::add_notification_block(CollectionChangeCallback callback) &
{
if (!m_notifier)
m_notifier = std::make_shared<_impl::ObjectNotifier>(m_row, m_realm);
even in result.cpp file. where ever the m_notifieris been used i am getting the same error
Please share the full text of the error message, verbatim, including file name and line numbers. My suspicion is that you’re building an older version of Realm than you think you are, since this particular error was fixed a few months ago. Sharing the precise error message you’re seeing will help us to confirm that.
I have the same issue while trying to run realm 2.8.1 on xcode 9 using swift 3.2 using mac os high sierra
the error is:
No viable overloaded '='
/Users/diegowatanabe/adhawk-ios-new1/adhawk-new/Pods/Realm/include/impl/collection_notifier.hpp:231:13: Candidate function not viable: no known conversion from 'typename enable_if::value, shared_ptr
@diego-watanabe, Realm v2.10.1 is the first version of Realm that supports the Xcode 9 GM release. Older versions were only tested against prerelease versions of Xcode, not the Xcode 9 GM release.
Hi Realm Team,
We started tring from 3.0.0-rc1 of realm . Even that is not working. i
am just attaching the a screen shot of the error in object.cpp file. and as
i have listed, there are many places , this error is occuring.
Thanks,
M.UmaMageswari

Your screenshot didn't come through, please re-attach it.
can you see the screen shot now?
@UmaRajesh, I'm not sure what version of Realm you're using, but it's definitely not v3.0.0-rc.1. The screenshot shows a copy of object.cpp identical to that found in realm/realm-object-store@9b159550e6310bdc6d1ccce355e8cb31a80aa2d1, which was current around 8 months ago. You can see at https://github.com/realm/realm-object-store/blob/f84d58a529ffb57e5b4d72c8d274c5215be0004a/src/object.cpp what the version used by v3.0.0-rc.1 looks like, and it's clearly different. For whatever reason, you're building a much older version of Realm than you intend to.
Have you run pod repo update recently to ensure that CocoaPods is aware of the most recent versions of all pods? If not, please do so.
I'd also suggest following the CocoaPods troubleshooting instructions mentioned in our documentation:
pod cache clean Realm
pod cache clean RealmSwift
pod deintegrate || rm -rf Pods
pod install --verbose
rm -rf ~/Library/Developer/Xcode/DerivedData
just followed all the below steps. still when i build its showing the same error.
pod cache clean Realm
pod cache clean RealmSwift
pod deintegrate || rm -rf Pods
pod install --verbose
rm -rf ~/Library/Developer/Xcode/DerivedData
I am little new to this environment. could you please let me know how to know the version of realm i have, by any commands.
Note : When i run "Pod update RealmSwift" I am getting the below error in terminal:
Pre-downloading: `RealmSwift` from `https://github.com/realm/realm-cocoa.git`, submodules `true`, branch `master`
[!] Failed to load 'RealmSwift' podspec:
[!] Invalid `Realm.podspec` file: Malformed version number string WARNING: The active Xcode command line tools, as returned by /Library/Developer/CommandLineTools, are not from Xcode.
The newest version of Xcode will be used instead.
3.0.0-rc.1.
# from /var/folders/m7/t47xg0fd4lbdlw_rvqtcb9xm0000gn/T/d20171005-7747-czkz0c/Realm.podspec:12
# -------------------------------------------
# s.homepage = "https://realm.io"
> s.source = { :git => 'https://github.com/realm/realm-cocoa.git', :tag => "v#{s.version}", :submodules => true }
# s.author = { 'Realm' => '[email protected]' }
# -------------------------------------------
Thanks for sharing that output. The immediate cause of the error it mentions is that you don't have a valid version of Xcode selected for your command-line tools. You can fix this by running sudo xcode-select -s /Applications/Xcode.app (fixing the path to Xcode.app as is appropriate for your system). After doing that, please try running pod update RealmSwift once more.
Thanks bdash!! now landing up to another error. Command sequence is as follows
sudo xcode-select -s /Applications/Xcode9.app
pod update RealmSwift
Pre-downloading: RealmSwift from https://github.com/realm/realm-cocoa.git, submodules true, branch master
[!] Unable to satisfy the following requirements:
Realm (fromhttps://github.com/realm/realm-cocoa.git, branchmaster) required by PodfileRealm (= 3.0.0-rc.1) required by RealmSwift (3.0.0-rc.1)That indicates your Podfile is specifying that Realm should use a branch from Git. It can't do that while also trying to install v3.0.0-rc.1. Easiest solution is to remove the Realm entry from your Podfile.
Now "pod update RealmSwift" is working. but i could not convert RealmSwift from swift 3 to swift4.
I am getting the below error:
Showing Recent Issues
Command failed due to signal: Segmentation fault: 11
CompileSwift normal arm64
cd /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods
/Applications/Xcode9.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/Aliases.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/Error.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/LinkingObjects.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/List.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/Migration.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/Object.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/ObjectiveCSupport.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/ObjectSchema.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/Optional.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/Property.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/Realm.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/RealmCollection.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/RealmConfiguration.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/Results.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/Schema.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/SortDescriptor.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/SwiftVersion.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/Sync.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/ThreadSafeReference.swift /Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/RealmSwift/RealmSwift/Util.swift -target arm64-apple-ios8.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode9.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk -I /Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Products/Debug-iphoneos/RealmSwift -F /Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Products/Debug-iphoneos/RealmSwift -F /Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Products/Debug-iphoneos/Realm -application-extension -enable-testing -g -import-underlying-module -module-cache-path /Users/uma/Library/Developer/Xcode/DerivedData/ModuleCache -swift-version 3 -enforce-exclusivity=checked -D DEBUG -serialize-debugging-options -Xcc -I/Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Intermediates.noindex/Pods.build/Debug-iphoneos/RealmSwift.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Intermediates.noindex/Pods.build/Debug-iphoneos/RealmSwift.build/RealmSwift-generated-files.hmap -Xcc -I/Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Intermediates.noindex/Pods.build/Debug-iphoneos/RealmSwift.build/RealmSwift-own-target-headers.hmap -Xcc -I/Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Intermediates.noindex/Pods.build/Debug-iphoneos/RealmSwift.build/RealmSwift-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Intermediates.noindex/Pods.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Intermediates.noindex/Pods.build/Debug-iphoneos/RealmSwift.build/RealmSwift-project-headers.hmap -Xcc -I/Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Products/Debug-iphoneos/RealmSwift/include -Xcc -I/Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/Headers/Private -Xcc -I/Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/Headers/Public -Xcc -I/Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/Headers/Public/FirebaseAnalytics -Xcc -I/Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/Headers/Public/FirebaseCore -Xcc -I/Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/Headers/Public/FirebaseInstanceID -Xcc -I/Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/Headers/Public/Google -Xcc -I/Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/Headers/Public/GoogleAnalytics -Xcc -I/Users/uma/Documents/GitHub/conpass-ios-retailer/Pods/Headers/Public/GoogleTagManager -Xcc -I/Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Intermediates.noindex/Pods.build/Debug-iphoneos/RealmSwift.build/DerivedSources/arm64 -Xcc -I/Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Intermediates.noindex/Pods.build/Debug-iphoneos/RealmSwift.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG=1 -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -Xcc -ivfsoverlay -Xcc /Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Intermediates.noindex/Pods.build/Debug-iphoneos/RealmSwift.build/unextended-module-overlay.yaml -Xcc -working-directory/Users/uma/Documents/GitHub/conpass-ios-retailer/Pods -emit-module-doc-path /Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Intermediates.noindex/Pods.build/Debug-iphoneos/RealmSwift.build/Objects-normal/arm64/RealmSwift.swiftdoc -serialize-diagnostics-path RealmSwift.dia -Onone -module-name RealmSwift -emit-module-path /Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Intermediates.noindex/Pods.build/Debug-iphoneos/RealmSwift.build/Objects-normal/arm64/RealmSwift.swiftmodule -emit-objc-header-path /Users/uma/Library/Developer/Xcode/DerivedData/conpass-ios-retailer-gfjbrzzgnbawtxaopwtjozvfbydi/Build/Intermediates.noindex/SwiftMigration/conpass-ios-retailer/Intermediates.noindex/Pods.build/Debug-iphoneos/RealmSwift.build/Objects-normal/arm64/RealmSwift-Swift.h -emit-dependencies-path RealmSwift.d -emit-remap-file-path RealmSwift.remap -o RealmSwift.o -embed-bitcode-marker
0 swift 0x0000000110e56dba PrintStackTraceSignalHandler(void) + 42
1 swift 0x0000000110e561f6 SignalHandler(int) + 662
2 libsystem_platform.dylib 0x00007fffb7724b3a _sigtramp + 26
3 libsystem_platform.dylib 0x00007fab4b8c01c8 _sigtramp + 2484713128
4 swift 0x000000010e48fff0 swift::migrator::updateCodeAndEmitRemap(swift::CompilerInstance, swift::CompilerInvocation const&) + 960
5 swift 0x000000010d7c6775 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef
6 swift 0x000000010d7c4784 swift::performFrontend(llvm::ArrayRef
7 swift 0x000000010d7796a8 main + 12248
8 libdyld.dylib 0x00007fffb7515235 start + 1
9 libdyld.dylib 0x0000000000000076 start + 1219407426
Stack dump:
Why are you trying to convert Realm Swift from Swift 3 to Swift 4? Realm Swift is _already_ written in Swift 4.
yeah thats my bad. i should not do that. thanks for the information and support
you is very good Thanks
@bdash Hi ,Sir. I am using a old version realm and want to upgrade it by myself. Now i face this problem , How can i fix the "no viable overloaded '='" issure.?
I have check the commits history carefully but did not find a solution.
Thank you with best wishes.
@LiuDeng, I strongly suggest updating to the most recent version of Realm. Older versions are not compatible with the latest version of Xcode, as the work to make them compatible was made as part of newer versions of Realm. We cannot provide any assistance in attempting to make older versions work in this situation..
Most helpful comment
Thanks for sharing that output. The immediate cause of the error it mentions is that you don't have a valid version of Xcode selected for your command-line tools. You can fix this by running
sudo xcode-select -s /Applications/Xcode.app(fixing the path to Xcode.app as is appropriate for your system). After doing that, please try runningpod update RealmSwiftonce more.