CocoaPods: [!] Unable to find a specification for 'Surge4Swift3' - ios

I'm new to CocoaPods. I just created a Github project and was hoping to include it in my Pods. It's giving me an error:
[!] Unable to find a specification for 'Surge4Swift3Plus'.
I've tried:
pod repo remove master
pod setup
pod install --verbose
Here's my Podfile:
target 'MyApp' do
use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'GeoFire', :git => 'https://github.com/firebase/geofire-objc.git'
pod 'Surge4Swift3Plus', :git => 'https://github.com/dmr07/Surge4Swift3Plus.git'
end
Do I need to do something special for the Github project?

I don't believe you can include just any git repository in your Podfile. CocoaPods needs to know what it is first. See the below link about making a cocoapod.
https://guides.cocoapods.org/making/making-a-cocoapod.html

Related

Am new but i need help in pod install my pod file also attached

[!] CocoaPods could not find compatible versions for pod "Firebase/core":
In Podfile:
Firebase/core
None of your spec sources contain a spec satisfying the dependency: Firebase/core.
You have either:
out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
mistyped the name or version.
not added the source repo that hosts the Podspec to your Podfile.
[!] Automatically assigning platform iOS with version 14.3 on target Spacechat because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.
Please help as I need to finish this task fast.
My podfile:
#platform :ios, '9.0'
target 'Spacechat' do
use_frameworks!
pod 'Appirater'
#Firebase
pod 'Firebase/core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Analytics'
pod 'Firebase/Crashlytics'
end
From https://github.com/CocoaPods/CocoaPods/issues/10449:
Pod spec/subspec names are case-sensitive. It should be Firebase/Core.
Also, not required, but recommended:
Firebase/Core is no longer recommended usage. Instead, directly specify the needed Firebase libraries. See https://firebase.google.com/docs/ios/setup#available-pods.
So an even better solution is to delete the line since it is redundant with Firebase/Analytics

Firestore build error in abseil with Swift and Cocoapods

I have a swift project that is using Firestore. There is a build issue when compiling the abseil pod that is included by Firestore. When I attempt to build the project, I intermittently get this error: absl/base/internal/inline_variable.h file not found.
I am using Xcode 11.4, Cocoapods 1.9.1, and Swift 5.
I have tried clearing derived data, updating pods, and deintegrating pods. The one workaround that seems to work is the following, but when I switch devices for a build, the error occurs again.
1. Comment out Firestore in the Podfile.
2. Run bundle exec pod install
3. Open Xcode and build.
4. Uncomment Firestore in the Podfile.
5. Run bundle exec pod install
6. Open Xcode and build.
These steps will work temporarily. Does anyone know of a way to get past this issue?
Here is the Podfile that I am using:
source 'git#git.myresearchapp.com:MyCompany/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'
target 'MyApp' do
use_frameworks!
pod 'RNCryptor'
pod 'KeychainSwift'
pod 'Sentry', git: 'https://github.com/getsentry/sentry-cocoa.git', tag: '3.11.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'UICircularProgressRing', '~>4.1.0'
pod 'IHKeyboardAvoiding', git: 'git#git.myresearchapp.com:MyCompany/IHKeyboardAvoiding.git', branch: 'master'
pod 'GTProgressBar'
pod 'AWSSNS'
pod 'AWSCognito'
pod 'AWSS3'
pod 'Validator', git: 'https://github.com/jlowe234/validator'
pod 'SwiftyOnboard', git: 'git#git.myresearchapp.com:MyCompany/SwiftyOnboard.git', branch: 'master'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Storage'
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
end
end
I solved this problem by updating to the latest version of Sentry. Apparently there is a build conflict between Firestore and version 3.11.0 of Sentry.
The fix is to change the Podfile entry for Sentry to the following:
pod 'Sentry'
After spending hours searching and trying to solve this issue, the only solution was to add a pre-compiled Firestore SDK.
add this line to the PodFile
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '7.3.0'
refer to firestore-ios-sdk-frameworks for more info

Xcode can't find interface declaration after running "pod install"

I've inherited an iOS project which uses cocoapods.
The repo includes the Pods directory with all the necessary pods frozen in time. If I clone the repo and build the app, all is fine. If I run pod update and then build, I get an error:
Cannot find interface declaration for COOperation.
The issue seems to be with a library called CompositeOperations, which is pulled in from a specific git account (not from cocoapods directly - not sure if that matters but just trying to give as much info as possible). Xcode is finding the library just fine, but for some reason it's not loading the Class declared in the interface file.
It seems silly to me to include the Pods directory in the repo. I feel like developers should clone the repo and then issue git install in order to pull down all dependancies.
Any suggestions for what I need to tweak in order for Xcode to successfully build my project?
The actual error in MessageScreenDataFetchOperation.h is:
/Users/user/src/myapp/myapp-iOS/Classes/Shared/Operations/MessageScreenDataFetchOperation.h:13:46:
Cannot find interface declaration for 'COOperation', superclass of
'MessageScreenDataFetchOperation'; did you mean 'NSOperation'?
And here's what MessageScreenDataFetchOperation.h looks like:
#import <CompositeOperations/COOperation.h>
#protocol GroupRef;
#interface MessageScreenDataFetchOperation : COOperation
- (id)initWithMessageId:(NSNumber *)messageId group:(id <GroupRef>)groupRef memberId:(NSNumber *)memberId;
#end
Here's my Podfile:
platform :ios, '8.0'
source 'https://github.com/CocoaPods/Specs.git'
target :MyTarget do
pod 'RestKit', '~> 0.24.0'
pod 'CompositeOperations', :git => 'https://github.com/stanislaw/CompositeOperations.git'
pod 'MBProgressHUD', '~> 0.8'
pod 'EKKeyboardAvoiding', '~> 2.0'
pod 'RBStoryboardLink', '0.1.0'
pod 'SWRevealViewController', '~> 2.0.0'
pod 'youtube-ios-player-helper', :git => 'https://github.com/stanislaw/youtube-ios-player-helper', :branch => '0.1.1-and-no-ads'
pod 'SZTextView'
pod 'MagicKit', :git => 'https://github.com/stanislaw/MagicKit'
pod 'ECPhoneNumberFormatter', :git => 'https://github.com/enriquez/ECPhoneNumberFormatter.git'
pod 'SSKeychain'
pod 'Mantle'
pod 'RSEnvironment', :git => 'https://github.com/rabovik/RSEnvironment'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
# Analytics
pod 'FlurrySDK', '5.1.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'NewRelicAgent'
# Logging
pod 'EchoLogger', :git => 'https://github.com/stanislaw/EchoLogger'
pod 'AFNetworkingLogger', :git => 'https://github.com/stanislaw/AFNetworkingLogger'
end
target :MyTargetUnitTests do
pod 'OCMock', '~> 3.0'
pod 'Kiwi'
pod 'JPSimulatorHacks', :git => 'https://github.com/plu/JPSimulatorHacks'
end
Have you tried adding CompositeOperations without using pods? That pod seems outdated to cocoapods:
https://cocoapods.org/?q=CompositeOperations
Turns out the version that was baked in to the Xcode project was a much older version. The Podfile didn't restrict by version number, so running 'pod update' updated the library to the latest version, which had significant changes, making it incompatible with my code base.
I figured it out by diffing Podfile.lock after running pod update and noticing the drastic difference in versions.
I went forward with deleting the Pods directory and the .xcworkspace file, but amended the Podile to restrict the library based off a specific tag.

iOS Swift - No module such as Firebase

This is my podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
target 'Grabit' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Grabit
pod 'Firebase','>= 2.5.0'
I tried:
Correct podfile like above.
Open project by terminal
Clean and rebuild project.
I tried it many times but I still get the error:
no module such as Firebase
These are my version of Firebase:
Installing Firebase 3.5.2 (was 3.5.2)
Using FirebaseAnalytics (3.3.1)
Using FirebaseInstanceID (1.0.8)
Any help is appreciated.
Things to check when getting this message:
no module such as Firebase
Does your Podfile file have use frameworks!? should look something like
use_frameworks!
target 'Project' do
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/Database'
end
target 'Project' do
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/Database'
end
Notice that if you want the latest version of a pod, you don't need to specify the version
Do you open your project with MyProject.xcworkspace (white icon) file and not with MyProject.xcodeproj (blue icon)?
Close Xcode and run pod install or pod update. Then open the MyProject.xcworkspace and build the project
Try Cleaning up the Project.
So far this works for me. Also I notice you're missing the "end"
target 'yourProjectname' do
platform :ios, '9.3'
use_frameworks!
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
end
This is working perfectly for me:
use_frameworks!
target 'Project' do
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/Database'
end
You don't need to set the version, by using just the name, you'll always get the latest version.
In Termin do pod install, then pod update.
Then completely clean your project with [CMD]+[ALT]+[SHIFT]+[K].
Then clean with [CMD]+[SHIFT]+[K].
Then close Xcode, start MyProject.xcworkspace (white icon) and build.
Delete Derived Data,Try Cleaning the Project and then Build, it will work then.

GeoFire giving problems with CocoaPods

I'm trying to add Geofire to my iOS project that uses Google Firebase as a backend. When I add the Geofire pod and run pod update I get this message in terminal...
[!] Unable to satisfy the following requirements:
- `Firebase` required by `Podfile`
- `Firebase (~> 2.1)` required by `GeoFire (1.1.0)`
Specs satisfying the `Firebase, Firebase (~> 2.1)` dependency were found, but they required a higher minimum deployment target.
Here is what my Podfile looks like...
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'HopUp' do
pod 'Firebase'
pod 'FirebaseAuth'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Storage'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'GeoFire', '>= 1.1'
end
Any thoughts as to why this is happening?
All input is appreciated!
One of the solutions was to add the git source to your pod file like so:
pod 'GeoFire', :git => 'https://github.com/firebase/geofire-objc.git'
Also, check out this github issue if you have any more problems. This is how I got GeoFire to work with my project.
After they updated Firebase Geofire stopped working, new version of Geofire is coming soon but not known exactly when.
You can try installing an earlier version of Firebase but sooner or later youll have to rewrite quite a bit of code after updating to a new one.

Resources