I upgraded Firebase today and now I am having a very unusual problem
Use of unresolved identifier FirebaseApp.
I have done everything as per the documentation provided by firebase here. I have insert GoogleService-Info.plist on my project and pod i have install are as follows:
pod 'Firebase/Core
pod 'Firebase/Database
pod 'Firebase/Messaging
I am using XCode 7.3.1 and my deployment target is 9.0
Any insight you can give is greatly appreciated! Thank you!
I had the same problem. They have renamed it to FIRApp.
Use FIRApp.configure() instead
It seems this is a potential bug in the latest release.
Try specifying import FirebaseCore instead.
On the terminal, run
pod update
solves the problem
I had a similar issue. Try deleting and uploading you Google file this way:
Instead of dragging the Google file directly into your Xcode project, right click the folder (inside your Xcode project) that you would like to save the Google file and click "Add Files to '[App Name]'..." and add GoogleService-info.plist that way. Also make sure the file is called "GoogleService-info.plist".
Install relative Firebase packages
pod 'Firebase/Analytics'
Import Firebase in Xcode
#import <Firebase.h>
Add firebase configure. I attached screenshot
if ([FIRApp defaultApp] == nil) {
[FIRApp configure];
}
Related
I believe the Snap Kit SDK may be faulty. I created a completely new iOS project, setup the Cocoapods workspace and then added:
pod 'SnapSDK'
With a sucesfull installation. I then as per the tutorial:
In my view controller added:
import SCSDKLoginKit
However I'm getting the error: No such module 'SCSDKLoginKit'
Any help would be appreciated.
The Cocapods installation method seems to be bugged at the moment. Instead of using CocoaPods, use Carthage to install. This should fix the error, as it fixed it for me.
Try to download individual SDKs to add to your project separately. In your Podfile, specify which kit you want. Each can be used independently.
This resolved issue of No such module 'SCSDKLoginKit'
pod 'SnapSDK', :subspecs => ['SCSDKLoginKit', 'SCSDKCreativeKit', 'SCSDKBitmojiKit']
After following the steps, i could deal with error of "import Firebase" to my AppDelegate, but still can not configure firebase in my code!
I already created a firebase account and downloaded 'GoogleService-Info.plist' and added it to my project and also used 'pod init', edited it to add Firebase Core, Auth, Database' and 'pod install' to create xcworkspace.
However after using 'import Firebase' in my AppDelegate, i received an error of 'Could not build Objective-C module Firebase'. I changed the product/scheme to 'Firebase' and the error was gone but still Firebase is not recognizable inside my code to be configured.
I would be so thankful for any clue!
open project use .xcworkspace file, when use pod install framework
So in the didFinishLaunchingWithOptions function in the AppDelegate.swift file, add FirebaseApp.configure() and make sure to delete. If you get the arm errors, make sure to stat a new project from scratch and add Firebase podfiles again. It should work.
maybe you have open project use xcworkspace
I'm trying to use the firebase pod, however getting this (see image) error message when a run is attempted.
I followed this guide to install Cocoapods and added the firebase dependency to the Podfile.
p.s I tried to clean it a bunch of times.
I got stuck for awhile trying to solve this, but the solution turned out to be very easy :)
If you are using Cocoapods in your project, one needs to use xcworkspace to build instead of xcproject.
If you are using Cocoapods and build from xcproject , it will ignore the Cocoapods libraries you need.
Sometimes its because of you might be declaring an object with same variable name.
Clear the repeating variable name change it. After that clean your project and build again.
Its worked for me....! Thanks.
I faced the same problem for hours and solved it with a simple hack. Just do clean and then Build
This error will also trigger when several components (files) with identical names were added to Xcode workspace.
Renaming them will fix this error.
A bit late, but what did the trick for me were cmd + q xcode, navigate to project folder, pod update, reopen open the .xcworkspace file, clean project and run/build again.
Sometimes occurs when you perform an invalid delete through cocoapods.
In my case I installed a framework through cocoapods which required bitcode set to "enabled", later when I longer needed it removed it from Podfile and pod install.
That's when encountered this error, solving it by setting the required targets to "disabled" in bitcode option.
I've got the same error when I was trying to configure cellIdentifiers in different Controllers.
I declared two variables globally with the same name. To solve this error I just renamed the second variable.
#import "ResultsTableViewController.h"
NSString *const kNormalCellidentifierName = #"NormalStoryCelll";
#interface ResultsTableViewController ()
#end
For me it was because the pod that I was using used Swift and I didn't include the use_frameworks! line in my podfile.
I didn't include that line before and therefore had to create a Swift file in my project and a Objective-C bridging header (which Apple offers to do for you the first time you add a swift file to your project).
If you told it not to create the bridge, then you can use this guys tutorial to manually create it as well as the settings needed.
I have tried a lot to fix this issue and failed for every attempt.
Then i just simply used:
pod install
and to my surprise, simply it solved my issue.
Update: I solved the question. Please see my answer below (underneath the question and comments).
This question was marked as a duplicate, but it's different because it is a brand new error that I couldn't find through any searches.
I tried installing Alamofire into my XCode project.
As per their their tutorial, I installed cocoapods onto my system.
I then navigated to the folder of my existing xcode project in the terminal, and did:
pod init
I then edited the new pod file and added:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target 'RainyShinyCloudy' do
pod 'Alamofire', '~> 4.4'
end
Finally, I executed the command:
pod install
My terminal told me the install was successful.
But when I opened the .xcworkspace, made a new swift class and tried to import Alamofire, I got this error:
One possible reason could be that I had tried to install an earlier version of alamofire earlier, deleted it and then installed this.
But I really don't know how that could have mattered.
Thanks for any help you guys can give me.
Actually it failed because you were trying to import AlamoFire and not Alamofire. Imports are case sensitive.
Update: I posted an answer earlier that was wrong.
But now I actually figured it out.
I made a new project, went to the settings menu by clicking on the name of my app in the project explorer.
Then I went to Linked frameworks and libraries which is at the very bottom of the General tab.
I pressed that little + icon, selected Alamofire.framework. and set the status to required
Following this, cleaning and rebuilding the project made the error go away.
I'm trying to create a swift program that uses sockets. In order to do that, I'm trying to use the SwiftSocket library by installing it using CocoaPods.
My Podfile is basic:
target 'socket' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for socket
pod 'SwiftSocket'
end
According to the installation guide of SwiftSocket, after installing the pod I should be able to use the TCPClient right away.
Still, I fail to use the class in my main.swift file as it doesn't find the class.
I've searched the web to see what I'm missing here, but all I found are guides on how to bridge Pods written in ObjectiveC but not on pods written in Swift.
Any help?
Thanks
EDIT: With jamshes reginahit suggestion, I've added SwiftSocket.framework to the Linked Frameworks and Libraries, in addition to the Pods_socket framework that was already present.
Now the build is successful, but I gut a runtime error of Thread1: signal SIGABRT with the payload:
yld: Library not loaded: #rpath/SwiftSocket.framework/Versions/A/SwiftSocket
Referenced from: /Users/jonathan/Library/Developer/Xcode/DerivedData/socket-buglawjxihebcabvcihcbdrtkcxt/Build/Products/Debug/socket
Reason: image not found
(lldb)
EDIT2: Something was funky with my Xcode. I've reinstalled it and now it seems to work fine. Thanks to everybody for the help. :)
I would like to comment, but I don't have enough reputation.
Anyway did you write something like:
import SwiftSocket
in the class where you need it? Also, did you open the project with the xcworkspace extension?
If nothing works try to clean and rebuild the project
Based on my checking of the SwiftSocket Library, it seems that what you did should be fine (it should be pod 'SwiftSocket' referring to "Installation" section), I assume that you missed to add :
import SwiftSocket
in your main.swift class.
And yes, they are not mentioning that in "Code examples" section because they -probably- assume that importing it in your .swift file should be obvious.
Once CocoaPods is finished installing, you need to start using the .xcworkspace instead of your .xcproject file. So close your project, open the workspace (same directory), and import SwiftSocket.
Your Podfile seems correct, after that, you need to launch a terminal from your project directory:
cd ~/Desktop/MyProject/
Then run: pod install command.
This will create a .xcworkspace file and a Pods directory.
Now you have to open the .xcworkspace file with Xcode.
Donc forget to import yout pod like this: import SwiftSocket
Also take a look at the CocoaPods documentation: https://guides.cocoapods.org/using/using-cocoapods.html