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.
Related
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
My scenario, I am trying to implement Google Firebase CoreML for text detection. Here, I installed a list of pods into my project but I still get Use of undeclared type 'VisionTextDetector'. How to fix this?
pod 'Firebase/Core'
pod 'Firebase/MLVision'
pod 'Firebase/MLVisionTextModel'
pod 'Firebase/MLVisionFaceModel'
pod 'Firebase/MLVisionBarcodeModel'
pod 'Firebase/MLVision'
pod 'Firebase/MLVisionLabelModel'
Below is my class file:
import UIKit
import Firebase
class TextViewController: UIViewController {
lazy var vision = Vision.vision()
var textDetector: VisionTextDetector? // Error: Use of undeclared type 'VisionTextDetector'
}
As the documentation didn't mentioned about the actual framework to be imported which is FirebaseMLVision, so with or without "Firebase", you much import actual "MLVision" framework. Just add below line on the top of your class file.
import FirebaseMLVision
Let me know, if you still face that error!
VisionTextDetector is no more supported so you have to use VisionTextRecognizer. no need to import FirebaseMLVision
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 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
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.