No such module 'Alamofire' in XCode 7.3 & Swift 2.2 - ios

I am integrating Almofire via cocoapods in my new swift project. After successful installation of Alamofire pod, i am unable to import it in my swift file. Xcode shows following error.
No such module 'Alamofire'
Following is my Podfile for reference
source 'https://github.com/CocoaPods/Specs.git'
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'CoreDataSample' do
pod 'Alamofire', '~> '3.4'
end
target 'CoreDataSampleUITests' do
end
I have already referred following issues in Almofire on github
Issue #551
Issue #1130
Also tried following things
Project clean
Project Build
Removed Derived Data
Any advise would be appreciate.

Try this inside your pod file
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target 'demoAlamofire' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for demoAlamofire
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire'
target 'demoAlamofireTests' do
inherit! :search_paths
# Pods for testing
end
target 'demoAlamofireUITests' do
inherit! :search_paths
# Pods for testing
end
end
I hope this will help you.

Related

Target overrides the `OTHER_LDFLAGS` build setting while installing pod in rn firebase

I am trying to add firebase in my react native app in ios. I have created Podfile with pod init. But when i'm trying to install pod with pod install i'm getting this error.
Also when i run the app it shows this:
i have already tried adding $(inherited) in target Build Settings -> Other linker flags. But somehow it's not working.
I'm using :
React Native "0.58.5"
React Native Firebase "^5.2.2"
Here is my Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'movit_driver' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for movit_driver
target 'movit_driverTests' do
inherit! :search_paths
# Pods for testing
end
end
target 'movit_driver-tvOS' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for movit_driver-tvOS
target 'movit_driver-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end

Linking an Objective-C framework with multiple targets in the same workspace with CocoaPods

I have a workspace with multiple framework targets and one application target. All of these targets depend on a common CocoaPod (GoogleMaps in this case). How should I write my Podfile so that all these targets can use GoogleMaps without it being duplicated across these targets?
My current Podfile is as follows:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'FrameworkA' do
# Comment the next line if you're not using Swift and don't want to use
# dynamic frameworks
use_frameworks!
# Pods for FrameworkA
pod 'GoogleMaps'
end
target 'FrameworkB' do
# Comment the next line if you're not using Swift and don't want to use
# dynamic frameworks
use_frameworks!
pod 'GoogleMaps'
# Pods for FrameworkB
end
target 'FrameworkTest' do
# Comment the next line if you're not using Swift and don't want to use
# dynamic frameworks
use_frameworks!
pod 'GoogleMaps'
# Pods for FrameworkTest
end
This allows me to use GoogleMaps in all targets but it ends up being duplicated in these targets. I can see errors like these being logged in the console:
Class GMSReverseGeocodeResponse is implemented in both /Users/harshad/Library/Developer/Xcode/DerivedData/FrameworkTest-ccpoenicmupoxyadfsxniyjogcjk/Build/Products/Debug-iphonesimulator/FrameworkA.framework/FrameworkA (0x104b73a30)
and /Users/harshad/Library/Developer/Xcode/DerivedData/FrameworkTest-ccpoenicmupoxyadfsxniyjogcjk/Build/Products/Debug-iphonesimulator/FrameworkB.framework/FrameworkB (0x1043b0a30).
One of the two will be used. Which one is undefined.
How can I fix this?
Edit: Here's the link to the Github project
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
def shared_pods
pod 'GoogleMaps'
end
target 'FrameworkA' do
shared_pods
end
target 'FrameworkB' do
shared_pods
end
target 'FrameworkTest' do
shared_pods
end

Unable to install Firebase into my Xcode project via cocoapods

I am trying to import Firebase into my Xcode file via Cocoapods 1.1.1. My pod file looks something like this.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Firebase Login' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Firebase Login
pod 'Firebase', '~> 3.11'
target 'Firebase LoginTests' do
inherit! :search_paths
pod 'Firebase'
end
target 'Firebase LoginUITests' do
inherit! :search_paths
# Pods for testing
end
end
I also tried this.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Firebase Login' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Firebase Login
target 'Firebase LoginTests' do
inherit! :search_paths
pod 'Firebase'
end
target 'Firebase LoginUITests' do
inherit! :search_paths
# Pods for testing
end
end
Afterwards, I typed pod install in my terminal and this is what I got.
Analyzing dependencies
[!] Unable to find a specification for `FirebaseAnalytics (= 3.6.0)` depended upon by `Firebase/Core`
Is this something I have done wrong or is it a bug with Firebase itself? If it's me, I would appreciate it if someone can help me solve this problem.
You should add those pods before target 'Firebase LoginTests' do
Otherwise you will only include them your test target.
your podfiel should look like this
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'AppName' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for AppName
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Database'
target 'AppName' do
inherit! :search_paths
# Pods for testing
end
target 'AppName' do
inherit! :search_paths
# Pods for testing
end
end

no such module 'Firebase' in Xcode (Swift)

I have been looking up on every website that had a similar/identical issue to this Xcode error and I have tried everything and nothing has worked. Most people say cleaning and building the project will make Firebase recognized but that hasn't worked. I've tried a bunch of different framework search paths but each framework is in a different folder, not one framework folder. This is my podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target 'Target' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Target
target 'TargetTests' do
inherit! :search_paths
pod 'Firebase', '>= 2.5.0'
# Pods for testing
end
end
these are my project folders
i've tried making my framework search path $(SRCROOT) and all variations and nothing works. My issue seems to be unlike any other that I can find from googling. I suspect its the framework search path but i don't know what to make it, and I could be wrong.
Any help would be greatly appreciated.
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Promposal
target 'Promposal' do
pod 'Firebase', '>= 2.5.0'
# Pods for testing
target 'PromposalTests' do
inherit! :search_paths
pod 'Firebase', '>= 2.5.0'
end
end
You were writing your podfile properly and you were adding the Firebase only to the test. Try this podfile and check.
It was good for me:
platform :ios, '10.0'
use_frameworks!
def shared_pods
pod 'Firebase'
end
target 'TargetName' do
shared_pods
end
target 'TargetNameDev' do
shared_pods
end

Firebase pod installation error

I am really stuck at this step of Firebase Installation to my iOS app.Firebase installation to Xcode I tried many times and finally I could install some 'pod files' to my project. But when i add import Firebase, error shown like
No such module 'Firebase'
Can anyone tell me how to install firebase pod into my existing ios project ? Also how to clear the pod I just installed to it.
I am using swift 2.2, Scode 7.3 and mac os x ei
my pod content is
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target ‘APPNAME’ do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for APPNAME
target 'APPNAME Tests' do
inherit! :search_paths
# Pods for testing
end
target 'APPNAME UITests' do
inherit! :search_paths
# Pods for testing
end
end
My Error :
image of my error
Add This Line in your pod file
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target ‘APPNAME’ do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'Firebase', '>= 2.5.1'
# Pods for APPNAME
target 'APPNAME Tests' do
inherit! :search_paths
# Pods for testing
end
target 'APPNAME UITests' do
inherit! :search_paths
# Pods for testing
end
end
and after that update pod

Resources