How do I avoid build errors when I include SQLCipher pod in Swift project? - cocoapods

I am using sqlite.swift
When I include this in my pod file:
pod 'SQLite.swift/SQLCipher', '~> 0.12.2'
Is SQLCipher still compatible with SQLite.swift?
Do I need additional pod statements to import SQLCipher and SQLite or just this one line?
XCode reports error when I build that look like this:
/Pods/SQLCipher/sqlite3.h:6907:10: Redefinition of 'sqlite3_index_orderby'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/sqlite3.h:6758:10: Previous definition is here
Pods/SQLite.swift/Sources/SQLiteObjc/include/SQLiteObjc.h:26:9: While building module 'SQLite3' imported from /Library/Developer/Xcode/DerivedData/SpeechCollector-btdxklvmapneuigwvexrhccrhodq/Build/Products/Debug-iphonesimulator/SQLite.swift/SQLite.framework/Headers/SQLiteObjc.h:26:
/:2:9: In file included from :2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/sqlite3ext.h:20:10: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/usr/include/sqlite3ext.h:20:

We had the same issue on our project, and we couldn't update to the next Xcode until this was solved.
The repo SQLite.swift looks abandoned, but among the pull requests there's this one that resolved the issue for our project.
What we did is download the repo and added it as a local dependency (we are using Cocoapods), then we added the changes that appear in that PR.
In file SQLiteObjc.h, we changed from
#import Foundation;
#if defined(SQLITE_SWIFT_STANDALONE)
#import sqlite3;
#else
#import SQLite3;
#endif
to
#import Foundation;
#if defined(SQLITE_SWIFT_STANDALONE)
#import sqlite3;
#elif defined(SQLITE_SWIFT_SQLCIPHER)
#import SQLCipher;
#else
#import SQLite3;
#endif
Hope this helps to you also.

Related

Bootstrap 4 beta using rubygem doesn't work with Jekyll

I just start using Jekyll recently for my personal project.
I'm using Jekyll-assets together with gem 'bootstrap-sass'; and everything works with charm.
This is what my main.css.scss look like:
#import '_sass/variables';
#import '_sass/scaffolding';
#import 'bootstrap-sprockets';
#import 'bootstrap';
#import 'font-awesome-sprockets';
#import 'font-awesome';
Everything works when I run jekyll serve.
However, when I try to use the latest beta version,
I got this error when I try to run Jekyll Serve
Incremental build: disabled. Enable with --incremental
Generating...
Error in _assets/css/main.scss:7 File to import not found or unreadable: bootstrap.
Load paths:
/Users/MacBookPro/.rvm/gems/ruby-2.3.0/gems/font-awesome-sass-4.7.0/assets/stylesheets
/Users/MacBookPro/.rvm/gems/ruby-2.3.0/gems/font-awesome-sass-4.7.0/assets/fonts
I commented out the #import 'bootstrap-sprockets.
It seems that Jekyll-assets does not found the bootstrap path.
I've already follow the step-by-step guide as stated in the documentation at [https://github.com/twbs/bootstrap-rubygem][1]
Currently I'm not using any package manager such as npm,yarn etc. Any help?

How do I compile sass imports automatically when I have edited them?

Im using Codekit to compile my sass, and Im splitting parts of my website into individual sass files so when it comes to editing I can easily find the file I'm looking for, But I've noticed that when I edit an import I have to go back to the main.sass style sheet and re-save so that it recompiles my changes, my question is, is their a way to automatically compile my main.sass file upon edit of an import ?
Main.sass
#import 'scss_files/_styles.sass'
#import 'scss_files/_service.sass'
#import 'scss_files/_outsource.sass'
#import 'scss_files/_branding.sass'
#import 'scss_files/_wordsearch.sass'
Maybe there is an error. Try to remove the file extensions of your imports (.sass) because in sass there is no need to include the file extension if you are importing a file

'Google/Analytics.h' file not found - XCode 7

I am having much trouble integrating Google Analytics SDK into my iOS project. I am using XCode 7 and targeting iOS 7. Using Swift 2.0. However I can get the sample working ok (not converting to Swift 2.0 though).
I've tried both install via CocoaPods and by copying the files manually from:
https://developers.google.com/analytics/devguides/collection/ios/v3/sdk-download
When installing via CocoaPods I've tried both
pod 'Google/Analytics'
,
pod 'GoogleAnalytics'
and
pod 'Google/Analytics', '~> 1.0.0'
Either case the XCode build fails with error
BridgingHeader.h:2:9: 'Google/Analytics.h' file not found
Failed to import bridging header '/Users/jonas.andersson/Projects/MyAppName/MyAppName/Supporting files/BridgingHeader.h'
This on row:
#import <Google/Analytics.h>
I've also tried to add
$(SRCROOT)/Pods/GoogleAnalytics
and the rest of the suggestions from Google/Analytics.h file not found when adding to AppDelegate
Update
Using pod 'GoogleAnalytics' and then #import <Google/Analytics.h> worked better. However then I get the following error:
Use of unresolved identifier 'GGLContext'
when I try setup GA from according to Google documentation:
var configureError:NSError?
GGLContext.sharedInstance().configureWithError(&configureError)
Solved it by going away from Googles own tutorial and not use GGLContext and importing headers directly.
My podfile:
platform :ios, ’7.0’
use_frameworks!
pod 'GoogleAnalytics'
And BridgingHeader.h:
#import "GAI.h"
#import "GAIDictionaryBuilder.h"
#import "GAIFields.h"
And setup:
let gai = GAI.sharedInstance()
let id = "my-GA-id"
gai.trackerWithTrackingId(id)
gai.trackUncaughtExceptions = true
gai.logger.logLevel = GAILogLevel.Verbose
Also added to User Header Search Paths:
$(SRCROOT)/Pods/GoogleAnalytics (recursive)
#import <GoogleAnalytics/GAI.h>
Instead of:
#import <GoogleAnalytics.h>
This what worked for me, XCODE9.0.

Trying to install foundation using compass

I get the following error when trying to get my project up on my mac.
LoadError on line 31 of /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb: no such file to load -- zurb-foundation
Note I have updated my gems, updated compass to the latest version, updated the foundation gem but I cannot get my stuff to compile. Also I tried creating a new project with the same settings but i get the same error.
What does your include look like? The library itself is just called foundation. On all my projects I include the path to my vendor files (usually bower_components) in my importPaths configuration, and include this in my main sass file:
#import 'foundation';

Include Susy with Nanoc

I'm trying to include Susy in my Nanoc project.
I followed the GitHub of ddfreyne. I installed Compass first and Susy next. Then, in my Gemfile I added the line: gem "susy".
In my stylesheet, I added #import "susy" Unfortunately, I have an error during the compilation which is Sass::SyntaxError: File to import not found or unreadable: suzy. I don't understand this error...
I'm using SASS to make my stylesheets.
I hope you'll be able to help me! Cheers.
The mistake was quite simple. I had to replace #import "suzy by #import "susy" in my stylesheet.

Resources