Getting error while installing realm through cocoapods - swift3

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

Related

TypeError: Cannot read property 'serve:before' of undefined on Ionic CLI 2.2.1 + Gulp 4

I am developing a Web Application that have a lot of legacy dependencies.
On the trial of updating some packages, I updated the gulp/gulpfile.js and tinkered then to run. Gulp was on version 3.5 and now is on 4.0.
By the way, the error thrown in the terminal by running : ionic serve --address localhost --nobrowser is :
Error: spawn cordova EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:
Please update your Cordova CLI to version >=4.2.0 `npm install -g cordova`
******************************************************
TypeError: Cannot read property 'serve:before' of undefined
at Object.runWithGulp (/usr/lib/node_modules/ionic/lib/cli.js:237:17)
at Object.runr (/usr/lib/node_modules/ionic/lib/cli.js:194:18)
at /usr/lib/node_modules/ionic/lib/cli.js:54:9
at _fulfilled (/usr/lib/node_modules/ionic/node_modules/q/q.js:787:54)
at /usr/lib/node_modules/ionic/node_modules/q/q.js:816:30
at Promise.promise.promiseDispatch (/usr/lib/node_modules/ionic/node_modules/q/q.js:749:13)
at /usr/lib/node_modules/ionic/node_modules/q/q.js:557:44
at flush (/usr/lib/node_modules/ionic/node_modules/q/q.js:108:17)
at process._tickCallback (internal/process/next_tick.js:61:11)
Cannot read property 'serve:before' of undefined (CLI v2.2.1)
Your system information:
Cordova CLI: undefined
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 5.4
Node Version: v10.16.3
Xcode version: Not installed
Then, some patch of the gulpfile.js :
gulp.task('build', gulp.series('bundle', 'copyTask', 'revTask', 'revReplaceTask'));
gulp.task('default', gulp.series('sassTask', 'cleanTask', 'build', 'watchTask'));
gulp.task('serve:before', gulp.series('cleanTask', 'watchTask', 'build'));
Before the tinkering, gulp.task('serve:before' [...]) functioned well. I guess it is related with the Ionic 2.2.1 CLI.
If someone could help me by a hint or an advice for mismatching the problem, I would be glad.
This happened to me while I upgraded Node to v12 which forced me to upgrade Gulp to v4.
The solution that worked for me is:
Go to npm\node_modules\ionic\lib\cli.js (Wherever it's located).
Change the following lines as such in cli.js:
237: if (true || gulp.tasks[beforeHook]) {
257: if (true || gulp.tasks[afterHook]) {
270: return Q.nfcall(null/*gulp.start.bind(gulp)*/, hookName)
Basically, the reason is that gulp.tasks and gulp.start don't exist in Gulp v4.
By putting true || in the first occurrences, gulp.tasks won't run and by putting null in the last occurrence, the gulp.start won't run.
I hope this helps the next people that encounter this problem.

Xcode9 Realm Error - No viable overloaded ‘=’

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.

Makefile error raspberry-pi 3

I have an issue with Codelite compilation, running on raspbian jessie - these are the (known) steps I have taken to produce it.
First I installed Codelite with apt-get install Codelite, then produced a c++ project.
When running build project I get the error:
/bin/sh -c ' -j 4 -e -f Makefile'
/bin/sh: 1: -j: not found
0 errors, 0 warnings
I note that this error has been found and corrected previously, through running a different version of Codelite from 6.1.1 (that which apt-get installs). I therefore found the updated version of armhf .deb codelite from the rasbian archive with gdebi-gtk. However the updated version (9.1.1) produces the following error (install attempt with the graphical debian):
Error: Dependency is not satisfiable: libclang 1-3.8 (>=3.2)
I do not understand why the package manager cannot update these packages - do they not exist for the pi? I ran the manager as root, so I do not think it is a permissions issue.
EDIT 1:
Thank you for that Fabre. My Enviromental Variables file now looks like this:
CodeLiteDir=/usr/share/codelite
export MAKE=make
I still get the same error however.

Rails 4 server fails, Ruby 2.0 segmentation fault, Abort trap 6

I just started going through railstutorial.org and getting my development environment setup. When I got to the section 1.2.5 to run rails server for the fist_app, I type the command and the following printed out:
$ rails server
/Users/aaronpflower/.rvm/gems/ruby-2.0.0-p481#railstutorial_rails_4_0/gems/sqlite3- < 1.3.8/lib/sqlite3/sqlite3_native.bundle: [BUG] Segmentation fault ruby 2.0.0p481 (2014-05-08 revision 45883) [x86_64-darwin13.2.0]
Then followed by 500 lines of text
0 enumerator.so
1 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/x86_64-darwin13.2.0/enc/encdb.bundle
2 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/x86_64-darwin13.2.0/enc/trans/transdb.bundle
3 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/x86_64-darwin13.2.0/rbconfig.rb
4 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/compatibility.rb
5 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/defaults.rb
6 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/deprecate.rb
7 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/errors.rb
8 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/version.rb
9 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/requirement.rb
Which ended with:
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
Abort trap: 6
When this first happened double checked the steps leading up to this in the tutorial, since being a beginner that was a high possibility. I typed the follow commands and everything checkout. (I'm also using OS 10.9.3)
$ rails -v
Rails 4.0.5
$ ruby -v
2.0.0p481
$ rvm -v
1.25.27
$ brew doctor
system ready to brew
Through searching some posts have suggested to uninstall sqlite3 and then re-install but I still got the same seg fault message. Not sure of the next step.
Your Rails -v and Ruby -v are correct for this tutorial.
I can also see from the input that your gemfile has gem 'sqlite3', '1.3.8' in it.
1: Have you bundled?
When was the last time you ran bundle update or bundle install?
How did you go about uninstalling sqlite3? Did you use $ gem uninstall sqlite3?
Try uninstalling and then reinstalling the gem.
2: - What version manager?
Did you use rvm, rbenv or homebrew to install? Using different version managers for different pieces can create communication issues.
3: Did you install Xcode?
This is taken from http://www.railstutorial.org:
"As a prerequisite, OS X users may need to install the Xcode developer tools. To avoid the (huge) full installation, I recommend the much smaller Command Line Tools for Xcode.
To install Xcode (my recommendation), look it up in the AppStore.
To install Command Line Tools (MHartl's recommendation) - https://developer.apple.com/downloads/
4: Are you using `bundle exec`?
Try bundle exec rails c and bundle exec rails s
5: Try 'refreshing' your bundle directory
If bundle exec doesn't work
Remove the .bundle/ directory and re-bundle with
rm -rf .bundle/ && bundle
I experienced the same issue, I just switched to a different ruby version
e.g;
rvm use 1.9.3-p484
and then bundle again.

Mac/Django error message: "/mercurial/osutil.so: no appropriate 64-bit architecture"

I'm new to Macs (and quite new to Django) and I'm setting up an existing Django/MySQL site that uses Mercurial as a site package, on a new Macbook Pro.
All was going well during installation - no error messages. I installed the default versions of most packages from macports.
However when I try runserver, localhost shows the following error message:
ImportError at /
.../lib/python2.6/site-packages/mercurial/osutil.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode)
Please could anyone advise? I've tried typing the following at the terminal:
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
but it didn't help.
I've gotten a similar error and a combination of two things helped me install Mercurial for OS X Lion. I'm running OS X 10.7.3.
First, there is a bug on line 455 of the setup.py script (at least for Mercurial 2.2.1, the version I tried). The line
version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines()
should be replaced with
version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0]
Second, after I installed Mercurial (either by easy_install, Mac OS X binary installer, and compilation), I kept getting the following error message:
ImportError: dlopen(/Library/Python/2.7/site-packages/mercurial/osutil.so, 2): no suitable image found. Did find: /Library/Python/2.7/site-packages/mercurial/osutil.so: mach-o, but wrong architecture
However, after seeing this post, I noticed that
defaults read com.apple.versioner.python Prefer-32-Bit
outputs 1 on my system. However, running this command
defaults write com.apple.versioner.python Prefer-32-Bit -bool no
and then recompiling / installing mercurial resulted in a working executable for me at the end.
If everything from my comment checks out, try setting that Prefer-32-bit in an user environment variable instead of at the command line.
Edit this file: ~/.MacOSX/environment.plist
See:
http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html#//apple_ref/doc/uid/20002093-113982