Xcode error importing module not being imported - ios

I left Xcode unsupervised for the weekend and I come back and it's telling me I have missing modules Corelocation and SQLite at:
import SQLite
import CoreLocation
both giving me the error Missing required module 'CSQLite'. I'm not sure where its getting "CSQLite" especially in relation to Corelocation
I have the SQLite.xcodeproj added to the general page to be linked it was building fine a couple days ago and absolutely nothing's changed.

In swift, if you want to use sqlite, you can either use modulemap feature of llvm to import c library or you can use cocoapods and import sqlite based any third party pod.

Related

XCFramework add third party library with Swift package manager duplicate symbols

Hi there i have the following usecase and have been building a couple days and finally got a bad solution that i don't really link and would really need some assistance on. Would be much appreciated if anyone helps out.
What i have:
I have a framework that uses Alamofire as a dependency with Swift package manager.
I build this framework for distribution with Alamofire it's automatically embedded and i want to make it not embeded just to use it for development until the other project uses it and adds it there.
Next step is add it to the other project. If i don't add Alamofire in the new project there is no issue.
If i add Alamofire there is a duplicate symbols. Anyone have a suggestion how to fix this? I currently don't have a good approach i tried out pretty much everything and as far as i understand it's in development still the SPM...
Example: MyFramework uses Alamofire with SPM and App uses SPM with Alamofire i get duplicate symbols.
What i expect:
A way to be able to add Alamofire into my framework project to use it for development. After when i generate my xcframework and add it to the next project to add the Alamofire lib there and to work without duplicate symbols.
Much appreciated any info.
You can try out #_implementationOnly import Alamofire instead of import Alamofire
This will not expose import Alamofire as public interface in .swiftmodule

Swift compiler crashes when importing RealmSwift

In a totally new project, with no code except for the default template, when I import RealmSwift Xcode shows a Swift compiler error like this:
I've followed the Realm installation guide many times over for both CocoaPods and manually installing into a project.
When I don't import RealmSwift, I can build the project.
I'm using Swift version 3.0.2.
I think you're hitting a known issue with the Swift compiler that leads to it crashing when you import a module with the same name as your application target. In this case, you've named your app target "Realm". That's the name of the Objective-C framework that RealmSwift depends on. Importing RealmSwift attempts to import the Realm module, which causes the compiler to get confused because it's not sure if that Realm module is referring to your app or the Realm framework. Renaming your application target so it doesn't share the name with any other modules you depend on should work around this compiler bug.

Why do I need to 'import 'framework'?

I'm working on a personal project and I've installed Firebase with Cocoapods and imported it in the bridging-header.
My question is why do I get an error if I try to use a Firebase method in my project if I haven't written import Firebase at the top? The same can be said for Google Analytics etc.
The reason I ask is because in this tutorial: Ray Wenderlich Firebase Tutorial
Firebase is configured the same way as mine - but none of the documents contain import Firebase, and the project recognizes any Firebase method universally without errors.
I know I can just use import but I don't understand what I am doing differently and would rather not have to.
I think u have in pod file line:
use_frameworks!
delete it and reinstall pods it should help
In the mentioned project, the import is done from the Grocr-Bridging-Header.h, it's actually an Objective-C import:
#import <Firebase/Firebase.h>
The reason why the import was done from Objective-C is beause the project is quite old and Cocoapods didn't have support for Swift then.

Xcode 6 Playground using Parse framework?

I would like to use Parse SDK/Framework my playground file but I get an error if I import it. I can import the iOS frameworks like UIKit
I know there are similar posts to this (How to I import 3rd party frameworks into Xcode Playground?)
but i could not make it work for my project.
Any help here is very very much appreciated... I am not a complete newbie but am not an expert So as many details (almost for dummies ;-)) as you can please...Many thanks.
To get Parse working in playground you will need to create an Xcode project and include the Parse framework. Then within that project you can add a playground and import frameworks and code written in that project. Hope this helps.
If you are curious I did it for a framework I created and created a Playground inside the projects workspace. In that I import Dollar which is a custom framework but I guess you could import Parse and it should work https://github.com/ankurp/Dollar.swift

Lexical or preprocessor issue: CoreLocation/CoreLocation.h not found

I have a readymade project in iOS which includes various frameworks like: MapKit , SDWebImage, CoreLocation , etc.
When i try to run the project i get error:
Lexical or preprocessor issue: CoreLocation/CoreLocation.h not found
But CoreLocation/CoreLocation.h is present. I deleted and again added the mapkit and corelocation frameworks. Still i get the same error.
I also cleaned and built the project- same error.
I even deleted the workspace and reopened it by referring this link :Compile, Build or Archive problems with Xcode 4 (and dependencies)
Still the same error.
How do i solve this? Any solutions are welcomed.
Assuming you're on Xcode 5, use #import CoreLocation instead of #import. This takes advantage of the new modules feature in LLVM to import the headers AND link against the framework for you.

Resources