Xcode9 Realm Error - No viable overloaded ‘=’ - c++

I just install Xcode 9 and build my native iOS project. (Is written in swift)
The project was OK in Xcode 8 but now, I obtain this error:
No viable overloaded '='
In the file: Pods\Pods\Realm\object.cpp
Line 42 => m_notifier = std::make_shared<_impl::ObjectNotifier>(m_row, m_realm);

If you are using Cocoapods, open up the Podfile and set the RealmSwift version to 2.8.1 (or 2.8.3 as David mentioned above). Here is my Podfile for Swift 3.0 using Xcode 9:
target ‘<PROJECT>’ do
use_frameworks!
# Pods
...
pod 'RealmSwift', '2.8.1'
end
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
Then, save the file and run:
pod install
If you're not setting a specific pod version (which I recommend), run the following command:
pod update RealmSwift
and it will automatically update to the most recent version (2.8.3).
Hope it helps to complement David's answer. Thanks!

The Realm team has worked on a new version allowing you to build your project with XCode 9.
Just update your Realm version to at least 2.8.1 (current version is 2.8.3)
https://github.com/realm/realm-cocoa/releases/tag/v2.8.1
The Realm release note of 2.8.1 clearly states :
Add support for building with Xcode 9 Beta 1.

Related

Cake Addins install fail error during build

I am using net 4.8 framework. and cake version 0.38.2.
During build in Teamcity, it has to install addins cake.npm, cake.filehelpers. But following error happens
Could not find any assemblies compatible with .NETFramework,Version=v4.6.1.
Error: Failed to install addin 'Cake.Npm'.
When I use cake.npm version as 0.17.0 for cake 0.38.2, it generates two folders - cake.npm and cake.npm0.17.0. Only cake npm0.17.0 is required, because it has netstandard2.0 which can make build successful. But the other folder makes it fail
As discussed in https://github.com/cake-contrib/Cake.Npm/issues/140 Cake.Npm is not the culprit, here.
There is an additional (#load) reference in the project to Cake.Sitecore in version 1.0.3 which in contents/scripts/tasks.restore.cake contains the line
#addin "Cake.Npm"
This - without an explicit version being set - will always default to the newest version (currently 2.0.0, which is incompatible with Cake 0.38.2).
The current version of Cake.Sitecore (1.0.27) has that problem fixed.

Compiling native node addon with c++ 17 inside fails during npm install on ubuntu

I have native add-on for nodejs that uses c++17 features, specifically "shared_mutex".
When I call npm install which downloads and compiles the add-on i get an error:
The linux machine has GCC 6.0 installed.
My Binding.gyp uses the following config to catch os type and add flags accordingly:
'conditions': [
['OS=="linux"', {
'CXXFLAGS': [
'-std=c++1z'
]}],
** i've also tried with '-std=c++17', '-std=c++1z'.
What am I missing?
Update:
1. Updated ubuntu 16.04 to GCC 16.04 and made it default.
2. It seems that when i try to compile it manualy using node-gyp rebuild "CXXFLAGS='-std=c++17'" it works and brings only one error:
"shared_,utex in namespace std does not name a type std::shared_mutex file mutex" (the last error)
Problem solved. For anyone who has the same issue, bind.gyp should use cflags_cc instead of cxxflags.

DropDown Swift 3 compile error

I upgraded my Podfile to us
target 'MyApp'
pod 'DropDown'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings['SWIFT_VERSION'] = "3.0"
end
end
end
When I try to compile, I get Swift3 compile errors with the DropDown pod. But their page says they support Swift3 natively. https://github.com/AssistoLab/DropDown
I am attempting to use Edit > Convert, I still get errors. Why is this happening? Same issue with AlamoFire. I updated to the latest version by removing the version requirement from the Podfile, removed Pods directory, pod install, updated my swift version to 3.0 in the target settings and I'm getting compile errors.
Rather than removing the version requirement, I would suggest explicitly defining a version that is Swift-3 compatible. It could be that your pods repo is out of date, so it's picking up older versions of the pods.

Getting error while installing realm through cocoapods

I am getting this strange error while installing realm on xcode 8, cocoa pods version cocoapods-1.2.0
The error is -
Installing Realm (2.4.3)
[!] /bin/bash -c
set -e
sh build.sh cocoapods-setup
./scripts/swift-version.sh: line 59: [: =: unary operator expected
No version of Xcode found that supports Swift 3.0.2
All other pods work great.
Thanks for the help in advance.
Hey for anyone looking for an answer -
I did find out that I had the second xcode installed (xcode 7), due to which the command line tools which were chosen were of xcode 7.3 which was causing the error.
So what I did was, I went to -
xcode >> preferences >> locations >> CommandLineTools
and selected the commandLineTools for the latest Version(xcode 8).
Thanks...
I too faced the same issue
xcode version - 8.1
error - No version of Xcode found that supports Swift 2.2
so I did the following
pod 'RealmSwift', :git => 'https://github.com/realm/realm-cocoa',
:commit => '2faba712db752fba8e85639e7023ce35ada0fb15', :submodules =>
'true'
For reference you may have a look to this link https://github.com/realm/realm-cocoa/issues/4534

Alamofire- getting 'No such module' error after successful Pod install

Xcode 8, Swift3, cocoapods 1.1+, ios10
I'm getting error - No such module. Below is my pod file and steps I followed. I even looked at same issues from previous versions and solutions mentioned in other threads didn't work.
Setup
Fresh, brand new Xcode 8 project.
Added Alamofire to my Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target ‘weatherkaka’ do
pod 'Alamofire', '~> 4.0'
end
Ran the command $ pod install
Install worked fine, and project compiles via workspace file
Opened xcworkspace file
Import: import AlamoFire
I get the error: "No such module: Alamofire".
What am I missing?
Note: I've done clean, re-open Xcode, clean more, re-compile etc. I've added the Alamofire framework to Linked Frameworks and Build phases.
You might get this error for the first time but try to run that project once and it might go away. Also you can command+click the import Alamofire and check that it points to the Alamofire.
You must be using projectName.xcworkspace not the xcodeproj.