I have to fetch all nearby ATM and for this I am using CCXGoogleNearbyPlaces framework using cocoapods (Reference: https://cocoapods.org/pods/CCXGoogleNearbyPlaces)
But I am not able to use CCXGoogleSDK class. I am getting this error:
you should need to import CCXGoogleNearbyPlaces.
import CCXGoogleNearbyPlaces instead of import CCXGoogleSDK
Related
I have a Swift 5.5 iOS project that already contains Firebase 7.x and uses Firebase Functions. I just upgraded to 8.13.0, because I want to use Codable support in Firebase Functions.
I added Firebase through the Swift Package manager and included Firebase Functions in my source code using:
import FirebaseFunctions
However, when I want to call:
func httpsCallable<Request: Encodable,
Response: Decodable>(_ name: String,
requestAs: Request.Type = Request.self,
responseAs: Response.Type = Response.self)
I get an error saying that it doesn't find this method.
Upon inspecting the packages, I discovered that the function I want to call is defined in FirebaseFunctionsSwift in a file called Callable+Codable .
This exists in my project as you can see:
However when I add import FirebaseFunctionsSwift to my source file I get the following error:
No such module 'FirebaseFunctionsSwift'
How can I solve this problem?
Add FirebaseFunctionsSwift-Beta framework to the build target:
Why I am getting error for that Firebase keyword
Try to import firebase
import 'package:firebase_core/firebase_core.dart';
You forgot to import firebase.
Try adding this to the beginning of your code,
import 'package:firebase_core/firebase_core.dart';
This library contains the keyword Firebase.
If it shows an error in this line, open root/pubspec.yaml and add this code after dependencies.
dependencies:
# ...
firebase_core: ^0.6.0
This will create a folder firebase_core.
If that doesn't work, then try watching a tutorial on youtube
Trying to use the CDYelpFusionKit api for an app, and I'm getting an error on the first step:
let yelpAPIClient = CDYelpAPIClient(apiKey: "myapikeyhere")
It's saying that it's an
Use of unresolved identifier 'CDYelpAPIClient'
but I have already installed the dependencies with cocoapods.
You also need to import the framework
import CDYelpFusionKit
I am using firebase and I have the following line of code:
let storageRef = FIRStorage.storage().reference()
which gives me the error 'use of unresolved identifier 'FIRStorage'.
These are my imports in my file:
import UIKit
import Firebase
In the video tutorial I am following the person in the video only has these two imports and gets no error. 'FIRStorage' also seems to be an actual class in the Firebase documentation. Is there an import I am missing? Is there something wrong with my frameworks or podfile?
Here are my pods:
Any help is greatly appreciated!
You need install FirebaseStorage to use it
Follow this instruction: https://firebase.google.com/docs/storage/ios/start
You need to the following steps:
import FirebaseStorage
FIRStorage has been renamed to Storage
Hopefully you find it helpful.
I'm getting this really weird error when trying to import UIKit in my swift file.
My Code is simply:
import UIKit
class Test: NSObject {
}
The error I get at 'import UIKit' is:
Unknown type name 'import'
Expected ';' after top level declarator
I have added UIKit to my Frameworks folder, the class doesn't contain any code (so therefore there shouldn't be anything wrong with it) and I tried to restart both xCode and my Mac, but the error is still there.
I appreciate any help.
Thanks.
EDIT:
Solved:
I tried to import 'Test.swift' in AppDelegate.
This problem usually happens when you try to import ".swift" file in your Objective-C code, like this: #import "HomeViewController.swift". This is wrong and you should import special, automatically generated Swift header, instead:
#import "ProductModuleName-Swift.h"
where ProductModuleName is the name of your module (or project) containing the Swift code.
Found good Trouble shooting guide - there is great Troubleshooting Tips and Reminders section!
https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html#//apple_ref/doc/uid/TP40014216-CH10-XID_87
The import stuff in swift is case sensitive. Example :
import uikit
will not work. You'll have to type it as
import UIKit
In my case, it was because somehow the selected type in the file inspector was objective-c source instead of Default - Swift Source even though i was using a .swift file.
Changing it to Default - Swift Source solved the issue for me.