I'm trying to add firebase to an existing project but I keep getting errors on building and after a couple of days searching the internet I have not yet fixed the issue :(
I've tried adding --deep to the signing flags, locking and unlocking the keychain, switching to use_modular_headers! in the Podfile.
I don't have a physical device to test on.
My Podfile looks like this:
# Uncomment the next line to define a global platform for your project
#platform :ios, '12.0'
target 'EyeArtifact' do
# Comment the next line if you don't want to use dynamic frameworks
#use_frameworks!
use_modular_headers!
# Pods for EyeArtifact
pod 'Firebase'
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Storage'
pod 'FirebaseUI'
pod 'FirebaseUI/Google'
pod 'FirebaseUI/Facebook'
pod 'FirebaseUI/OAuth'
pod 'FirebaseUI/Phone'
pod 'FirebaseFirestoreSwift'
# Facebook pods
pod 'FBSDKCoreKit', :modular_headers => true
pod 'FBSDKLoginKit', :modular_headers => true
end
and my error is:
/Users/jvines/Library/Developer/Xcode/DerivedData/***-bgaqkzrrqevduaadrswisdyouwqv/Build/Products/Debug-iphonesimulator/***.app/Frameworks/AppAuth.framework: replacing existing signature
/Users/jvines/Library/Developer/Xcode/DerivedData/***-bgaqkzrrqevduaadrswisdyouwqv/Build/Products/Debug-iphonesimulator/***.app/Frameworks/AppAuth.framework: code object is not signed at all
In architecture: x86_64
If I switch between use_frameworks! and use_modular_headers! I get another error: BoringSSL-GRPC.modulemap' not found when building
I've tried disabling the signing script when building but then if I run the app I get this error: dyld: Library not loaded: #rpath/AppAuth.framework/AppAuth
The simulator is running iOS 14.2 and I'm using Xcode 12
I also tried a brand new project and adding the frameworks from scratch but I encountered the same errors.
I'm new to iOS development so any help is greatly appreciated!
Thank you :)
Found the answer to my problem here: https://stackoverflow.com/a/62172769/14828440
In short I was missing the bridging header even though I don't have any swift files.
I have an app in which I am using cocoapods to download third party libraries. I have Salesforce sdk and also firebase. Both Salesforce's SmartStore and Firebase are dependent on FMDB. If I remove Firebase pod and do a pod update it is compiling fine without any error. But, if I add firebase libraries to Pod, I get
Library not found for -lFMDB
Linker command failed with exit code 1 (use -v to invocation)
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
target 'App' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
use_modular_headers!
# Pods for App
source 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
pod 'Firebase/Analytics'
pod 'Firebase/Crashlytics'
pod 'SalesforceSDKCore','7.3.0'
pod 'SmartStore','7.3.0'
pod 'SmartSync','7.3.0'
pod 'SalesforceAnalytics','7.3.0'
pod 'SalesforceSDKCommon','7.3.0'
end
I am not sure what is the problem and how to resolve it. Any help is much appreciated.
In case if anyone else has the same problem, remove libraries from Other Linker Flags. As in pod file, I have use_frameworks! in pod file,I believe you don't have to mention them in Other Linker Flags.
I am trying to use the GooglePlaces iOS API; however, every time I follow the directions for installing it via CocoaPods, I always get a Linker Command error. I've tried the steps about a million times and always get that error after building. Furthermore, I am using the workspace file that documentation recommends and I believe that I have followed all of the steps correctly. Can someone please help me?
Xcode version: 8.3.2 (8E2002)
Pod File Content:
source 'https://github.com/CocoaPods/Specs.git'
target 'MoodSwings' do
pod 'GooglePlaces'
end
Xcode Error:
ld: framework not found GoogleMapsBase
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thanks!
First I Deintegrate Cocoapods from your project using this link Deintegrating and Removing Cocoapods from your project after that using pod init I create pod file again this is the podfile updated content
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MoodSwings' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MoodSwings
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'GooglePlaces'
pod 'GooglePlacePicker'
pod 'GoogleMaps'
target 'MoodSwingsTests' do
inherit! :search_paths
end
target 'MoodSwingsUITests' do
inherit! :search_paths
# Pods for testing
end
end
After that I remove all configurations in Build Setting -> Framework Search Path and your project finally works!!
here is the repo Github repo
I've been banging my head against a wall with this for the last few days but despite multiple Google/SO/Github searches I can't find a resolution to the issues I'm having!
All I'm trying to do is create some unit tests for my app which makes use of Firebase pods.
I'm using Xcode 7.3.1 & Cocoapods 1.0.1. Update: Issue remains with Xcode 8.0
With this podfile:
platform :ios, '9.0'
use_frameworks!
inhibit_all_warnings!
target 'MyApp' do
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
target 'MyAppTests' do
inherit! :search_paths
end
end
In my XCTest class I get
Missing required module 'Firebase'
error at #testable import MyApp
Alternatively with this podfile:
platform :ios, '9.0'
use_frameworks!
inhibit_all_warnings!
def common_pods
pod 'SwiftyTimer'
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
end
target 'MyApp' do
common_pods
end
target 'MyAppTests' do
common_pods
end
The tests build but my console is littered with warnings e.g.:
Class <-FirebaseClassName-> is implemented in both ...MyApp... and
...MyAppTests... One of the two will be used. Which one is undefined
I had the same issue. I solved it by moving pod 'Firebase' to my test target. Change your Podfile to this:
platform :ios, '9.0'
use_frameworks!
inhibit_all_warnings!
target 'MyApp' do
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
target 'MyAppTests' do
inherit! :search_paths
pod 'Firebase'
end
end
Try changing the inheritance to :complete, as in:
target 'MyAppTests' do
inherit! :complete
end
Importantly it allows anyone else checking out your repo to just do a pod update as usual without having to copy .xcconfig files or other hackery just to build.
Select your Unit Test Target setting.
Go to Build Settings.
Look for Header Search Paths.
Add this value $(SRCROOT)/Pods with recursive, then Xcode will resolve the path for you.
Here is Example
The issue is that Firebase does something special with the Header Search Paths after CocoaPods generates its own value for the setting so CocoaPods doesn't pick up on this change in order to carry it over to the test target. You can solve this one of two ways:
Locate MyAppTests.<configuration>.xcconfig in the file navigator and add the following to HEADER_SEARCH_PATHS:
${PODS_ROOT}/Firebase/Analytics/Sources [*]
Find the setting for Header Search Paths in Build Settings and add that same value as in option 1 to the list. You shouldn't need to set it as recursive.
* As per AKM's comment, this changed to ${PODS_ROOT}/Firebase/Core/Sources in version 3.14.0
Adding ${SRCROOT}/Pods/Firebase/CoreOnly/Sources into the unit test target's "Header search paths" fixed the problem.
Steps:
Select your unit tests target
Go to Build Settings
Search for header search path
Add ${SRCROOT}/Pods/Firebase/CoreOnly/Sources
After this the tests can run and the error will disappear.
Three Steps before I could get this to work:
CocoaPods : 1.5.0
Swift 4
Firebase : 4.13.0
Step 1:
Make sure to add the following target block into your podfile.
# Uncomment the next line to define a global platform for your project
platform :ios, '11.3'
target 'TIMII' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for TIMII
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
target 'TIMIITests' do
inherit! :search_paths
pod 'Firebase/Core'
end
end
Step 2:
Within the YourAppTests Project Navigator Build Settings tab. Find the Header Search Path row and add to Debug the following line
$(inherited) ${PODS_ROOT}/Firebase/Core/Sources
Step 3:
In terminal run:
pod update
A simpler method that also works:
target 'MyApp' do
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
target :MyAppTests
end
The problem is recorded in the firebase project here:
https://github.com/firebase/firebase-ios-sdk/issues/58
There is a workaround:
Add "${PODS_ROOT}/Firebase/Core/Sources" to your Tests target only
under Build Settings -> Header Search Paths
but this is also fixed by upgrading to CocoaPods 1.4.0 or later, which is a better solution.
At the time I'm writing this (November 2017) cocoapods 1.4.0 is still in beta, so to install it you need to explicitly request the beta:
gem install cocoapods --pre
This and then doing a pod install solved the problem running my tests.
I tried all the above and ran into various different errors, originally starting with Missing required module 'Firebase', then getting "Class ... is implemented in both ... " or linker issues if I tried to add Firebase Pods to my test target.
The solution that worked for me was to:
Remove test target entirely from Podfile and run 'pod update' to ensure the XCode project is in sync.
Open my test target's Build Settings and update header search paths to only include the following 3 items:
$(inherited) non-recursive
$(SRCROOT)/Pods/Headers/Public recursive
$(SRCROOT)/Pods/Firebase recursive
At this point cleaning the build folder, re-building then re-running the tests worked for me. Hope this helps someone!
The solution for me was to update cocoapods to version 1.1.0.rc.2.
sudo gem install cocoapods --pre
I had a similar problem. Phrased in terms of your question, I copied the contents of my MyApp.<configuration>.xcconfig file to my MyAppTests.<configuration>.xcconfig file. I cleaned and built the tests, and it worked.
Add "${PODS_ROOT}/Firebase/Core/Sources" to your Tests target only under
Build Settings -> Header Search Paths
As #Will mentioned an issue around Header Search Paths after CocoaPods installation.
I have a project with multiple targets where pod 'Firebase' embedded into separate module, lets say MyProject-Shared. Firebase pod at 'Podfile' installed only for 'MyProject-Shared' target. Other modules, which wants to use 'MyProject-Shared' can't be compiled due an error:
'missing required module "Firebase" '
The trick in my case was to add following missing header search path at each target's Build Settings referencing to Analytics-Framework:
"${PODS_ROOT}/Firebase/CoreOnly/Sources"
Please see pic below:
Hope it will save your time.
Missing required module Firebase NO CocoaPods solution
For those who encounter the same problem but NOT using CocoaPods:
If you're using Firebase, than you have some folder containing Firebase.h and module.modulemap file. For example - YOUR_PROJECT_DIR/Linking
If your Main project target is working correct way, than you should go to ProjectSettings -> Targets. Select test target. Search for User headers and add the path to YOUR_PROJECT_DIR/Linking. Select recursive option and you should be good to go.
See the screenshot for more details:
I posted a similar question yesterday but please bear with me. I am trying to install libraries such as ObjectMapper, Alamofire, etc. using Cocoapods (updated to latest version). I can successfully install the pods but as soon as I open <>.xcworkspace, I get build errors in the library files. I had installed SwiftyJSON a month ago using CocoaPods and it didn't give me a problem at the time. I tried installing SwiftJSON in an entirely new project using CocoaPods and it is giving me the build issues now. Please help! There are no references for this!
My current Cocoapods version is 0.38.2. My project's deployment target is 8.4.
This is my Podfile
# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'
target 'retailcatalogue' do
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'SwiftyJSON'
end
target 'retailcatalogueTests' do
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'SwiftyJSON'
end
My current version of Xcode is Version 6.4 (6E35b). Could that be a factor?
I just updated my Xcode to 7.0.1 and everything's working great! Thank you everyone!
Try using this:
use_frameworks!
target 'retailcatalogue' do
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
end