I am getting the following error
ld: framework not found FirebaseCore
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have tried all the things, like cleaning, reintegrating and updating and installing the PODS, nothing seems to work. Please help. Here is my PODFILE. I have been struggling for the past 2 weeks with this crazy thing
target 'MyProject' do
use_modular_headers!
# use_frameworks!
pod 'GoogleMaps'
pod 'GooglePlaces'
pod 'Alamofire'
pod 'SwiftyJSON'
pod 'SwiftKeychainWrapper'
pod 'FBSDKCoreKit', '4.35'
pod 'FBSDKShareKit', '4.35'
pod 'FBSDKLoginKit', '4.35'
pod 'GoogleSignIn'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
pod 'Firebase/Crash'
pod 'FirebaseStorageCache'
end
If you look at the workspace in Xcode but cannot drill into the project from there then your issue is that your workspace is not opening properly. There should be an expand arrow next to the project name in the workspace explorer. In my case it was because the Project file was being opened by Xcode first before it was opening the Workspace. Since the project was already in use it could not be used again by the workspace. There is no appropriate error message to alert you to this situation.
To fix:
Open xcode
Close all projects and workspaces
Close Xcode (Now the next time you open Xcode it will not open your old project first by default)
Open the Workspace file
Now you should be able to drill into your Xcode project from within your workspace.
I wrestled with this problem as a noob to CocoaPods and Analytics and working with Workspaces. I had added CocoaPods and Firebase to an existing application that had not used CocoaPods before. Once you add CocoaPods you should only ever open the Xcode project through the Workspace.
FWIW: I found this link useful to understand what was going on: Xcode Project vs. Xcode Workspace - Differences
Try it to do by Changing the deployment target to iOS 11. It worked for me.
Related
I am using firebase for tracking crashes in my project and i am using the below pods in my project.
pod 'FirebaseCore', '6.6.4'
pod 'FirebaseMessaging', '4.3.0'
pod 'FirebaseAnalytics','6.3.1'
While archieving this project for placing the testflight build, i am getting duplication error below for google utilities :
Multiple commands produce '/Path/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework':
1) Target 'GoogleUtilities-00567490' has create directory command with output '/Path//IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'
2) Target 'GoogleUtilities-54e75ca4' has create directory command with output '/Path//IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'
When I checked my Pods settings in my build setting, I saw google utilities added twice in project. I have removed the one of the GoogleUtilities it's getting an error.
Note: I can able to run the build and I can't able to archive it. Is there any fix for achieving this build, without changing the legacy build system?
Because I have enabled the library distribution for my SDK, so when I made changes into legacy its throws an error.
Adding pod 'GoogleUtilities', '~> 7.7.0' to all the targets that use Firebase pods will make it work. In my case, this included 3 targets: iOS app, iMessage Extension and UnitTests.
No need to add this part explicitly:
def google_utilites
pod 'GoogleUtilities/AppDelegateSwizzler'
pod 'GoogleUtilities/Environment'
pod 'GoogleUtilities/Logger'
pod 'GoogleUtilities/MethodSwizzler'
pod 'GoogleUtilities/NSData+zlib'
pod 'GoogleUtilities/Network'
pod 'GoogleUtilities/Reachability'
pod 'GoogleUtilities/UserDefaults'
end
Update the Podfile to explicitly request all the needed GoogleUtilties subspecs. Examine the Podfile.lock to find the list.
There is a lot more detail at this CocoaPods issue.
This issue occurred to me when i added a new target to my project using very similar but not equal firebase dependencies, so GoogleUtilities was duplicated because my other target doesn't need as much dependencies from utilities as the main one so, basically (with the help of Paul Beusterien answer) went to the Pods project and look at both targets (GoogleUtilities-xxx) -> Build Phases -> Compile Sources and look at the differences in files added, basically in the new target was missing 'GoogleUtilities/UserDefaults' and 'GoogleUtilities/MethodSwizzler' but this can be different in any case, so i just did a compilation like this
platform :ios, '13.0'
def google_utilites
pod 'GoogleUtilities/AppDelegateSwizzler'
pod 'GoogleUtilities/Environment'
pod 'GoogleUtilities/Logger'
pod 'GoogleUtilities/MethodSwizzler'
pod 'GoogleUtilities/NSData+zlib'
pod 'GoogleUtilities/Network'
pod 'GoogleUtilities/Reachability'
pod 'GoogleUtilities/UserDefaults'
end
abstract_target 'AggregatedPodsTarget' do
use_frameworks!
google_utilites
pod 'FirebaseCore'
pod 'FirebaseAuth'
pod 'FirebaseFirestore'
pod 'FirebaseStorage'
pod 'FirebaseFunctions'
pod 'FirebaseAnalytics'
pod 'FirebaseMessaging'
pod 'Firebase/Crashlytics'
pod 'Google-Mobile-Ads-SDK'
target 'MainApp' do
end
target 'MainApp Dev' do
end
end
abstract_target 'ExtensionPodsTarget' do
use_frameworks!
google_utilites
pod 'FirebaseAuth'
pod 'FirebaseFunctions'
target 'Extension' do
end
target 'Extension Dev' do
end
end
after this i just did pod install and i went back to have only one GoogleUtilities Dependency
This worked for me, it's similar to this Bogdan's answer
Summarising steps
Add pod 'GoogleUtilities' so they don't clash from different targets
Clean install your pods (pod deintegrate and pod install)
Might need pod repo update.
Reopen xcode and archive, you would see single GoogleUtilities now
I saw this error when I tried archiving one of my projects where I had recently introduced another new target.
Going into the pod settings for this new target, I noticed that the iOS deployment version was different (14.4) from the iOS deployment version in the main Runner target (12.0) - something I had missed when I was initially configuring this new extension target.
The only difference between the iOS deployment versions I saw was that 14.4 had App Extensions enabled. Since that was something inconsequential to my project, I was happy matching the iOS deployment
versions for both my targets so they could refer to only one set of dependencies. After that, I just removed the duplicate pods for the version that I had removed. And I could archive again.
For each of your Targets, got to Build Settings -> check the iOS Deployment Target -> change the version so that they match.
For most circumstances, there is no reason why they should be different. But if for some reason you deem they should be different, checkout Paul Beusterien's answer and follow that.
We had the similar issue on Flutter project using firebase_core and firebase_analytics dependencies. Adding pod 'GoogleUtilities', '~> 7.7.0' in all the targets in the Podfile under ios folder.
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'GoogleUtilities', '7.7.0'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
target 'customnotificationext' do
use_frameworks!
pod 'GoogleUtilities', '7.7.0'
end
After updating to the latest Xcode to support ios12
I can't build my project
It seems that none of the pods are being compiled.
I'm getting an error for unknown import such as "file not found" (ex 'SDWebImage/UIImageView+WebCache.h' file not found)
(if I comment everything related to this, it's just showing an error for the next package that does not exist)
for plugins installed from pod.
if I add the pod scheme and compile it, and then compile my project all the imports are working fine
but then I get this compiler error for every package:
Showing Recent Messages
:-1: ignoring file
/Users/administrator/Library/Developer/Xcode/DerivedData/XXXProject-
ajmnddfiwycmqihdrqgzcltbrovs/Build/Products/Debug-
iphonesimulator/Pods_XXXProject.framework/Pods_XXXProject, file was
built for archive which is not the architecture being linked (i386):
/Users/administrator/Library/Developer/Xcode/DerivedData/XXXProject-
ajmnddfiwycmqihdrqgzcltbrovs/Build/Products/Debug-
iphonesimulator/Pods_XXXProject.framework/Pods_XXXProject
My pod file is very simple, my projects have 3 extensions
It worked fine before the update.
I've tried removing, installing few times, updated my pod to 1.5.3
Nothing seems to work.
(tried even with the pod beta version 1.6)
Tried both Legacy and New System build getting same error for both.
In the project build phases, everything seems fine and should be copied.
(using use_frameworks!)
This is how my podfile looks like
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target ‘XXXXX’ do
pod 'GoogleAnalytics'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'FBAudienceNetwork'
pod 'FBSDKLoginKit'
pod 'Fabric', '~> 1.7.6'
pod 'Crashlytics', '~> 3.10.1'
pod 'AccountKit'
pod 'SDWebImage', '~> 4.0'
pod 'BEMCheckBox'
end
Any ideas what's wrong?
This is the problem of your previous cache store in the derived data folder.
Go to the DerivedData folder.
Close XCode.
Delete your apps from DerivedData folder.
Reopen XCode, clean project and run again.
XCode preference > Locations > Derived Data (click right side icon in the directory path, it will open DerivedData folder)
Select your pod from the left project navigator. > Select Target. >
Select "Build Settings". > Build Active Architecture Only to No
Here is another case: make sure "Scheme" > "Build" > "Find Implicit Dependencies" is turned on.
I turned it off (tried to fix another problem) and spent quite some time trying to fix the build.
In my case
pod deintegrate
pod clean
pod install
then rebuild the project works.
My XCode = 11.3.1
I had the same problem with Xcode 10 and newly added pods.
I've noticed new pod was not added to Target -> Build Phases -> Link Binary With Libraries. When I added new pod-framework manually, archiving worked ok.
Having a react-native project, which won't build on target "Staging" since I've setup cocoapods and using xcworkspace file since then (needed for firebase integration of react-native-firebase). When trying to build for taget "staging", I'll get this error:
ld: library not found for -lPods-[app]
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It works on debug, and (well at least it doesn't throw an error) when I archive the project.
I've having a "staging" target because of code-push. Using react-native at version 0.48.4 and Xcode 9 (created it following this guide, but before using cocoapods)
My podfile:
platform :ios, '9.0'
target 'xx' do
#use_frameworks!
# Pods
pod 'Firebase/Core'
pod 'Firebase/Analytics'
pod 'Firebase/Database'
pod 'Firebase/Messaging'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
end
Tried with and without use_frameworks!, cleaning project, deleted DerivedData, deintegrating and reintegrating pods.
What could cause this? (Please tell me if you need more information)
What worked for me:
Deintegrated all pods using pod deintegrate (using enter link description here)
pod install
Removed [Project name] > Frameworks > Pods_[Project name].framework (which was red, but there are actually more files being red)
Build succeeded
Was doing this with the help of this post. Thanks also to Maurice for trying to help me.
I had this issue. In my case it was a react-native app added Firebase Analytics. As of July 2018, all apps must be built with iOS 11 per Apple: developer.apple.com/ios/submit/
Once I went to my General tab and scrolled down to Deployment Info / Deployment Target and changed it from 10.x which is what I was targeting, to 11.x - the app built/archived and I was able to submit.
Set your PODS_CONFIGURATION_BUILD_DIR of "staging" as "release" ${PODS_BUILD_DIR}/Release$(EFFECTIVE_PLATFORM_NAME).
Check the Frameworks folder and remove red files.
check whether the SEARCH_PATHS is correct at Pods-XXXX.debug.xcconfig or Pods-XXXX.release.xcconfig
LIBRARY_SEARCH_PATHS = $(inherited) "$(PODS_ROOT)/path/to/your folder"
I keep getting this error when compiling an Xcode project and cannot for the life of me figure out what the issue is.
ld: framework not found GTMOAuth2
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am working from an .xcworkspace with a Podfile that has:
use_frameworks!
pod 'Firebase', '~> 4.0'
pod 'Firebase/Core'
pod 'Firebase/Invites'
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
pod 'TwitterKit'
pod 'GoogleSignIn'
pod 'GTMOAuth2'
amongst other things. It finds all of the platforms save GTMOAuth2. What is strange is that otherwise everything seems in order - I'm opening the correct xcworkspace and definitely not an xcodeproj
My Pods directory seems in order:
In my pods I see it as a target:
This should do it. Interestingly, when I add it as a Linked Framework and Library, it comes up gray...
Also, in the build directory, I see both:
/Build/Products/Release-iphonesimulator/GTMOAuth2/GTMOAuth2.framework
and
./Build/Products/Release-iphoneos/GTMOAuth2/GTMOAuth2.framework
but to no avail, GTMOAuth2 is not found. No clue how to proceed - any tips would be really helpful! I should mention that I'm new to iOS development and that the project is in the context of a React Native App.
-l"GTMOAuth2" Remove this line
then Compile:)
This worked for me
Go to Target -> Build Settings
Inside Framework Search Paths, delete the paths
I added Firebase libraries to my project, and then I got this error. When I compile it, Xcode can't find some directories. However, they are in the Pods directory.
Here is the error log:
ld: warning: directory not found for option '-F/Users/Erumaru/Library/Developer/Xcode/DerivedData/ToDoTogether-gkzytezmbbgkikgoxjpptxgrixil/Build/Products/Debug-iphonesimulator/GTMSessionFetcher'
ld: warning: directory not found for option '-F/Users/Erumaru/Library/Developer/Xcode/DerivedData/ToDoTogether-gkzytezmbbgkikgoxjpptxgrixil/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac'
ld: framework not found GTMSessionFetcher
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here is my Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'ToDoTogether' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
platform :ios, '10.0'
pod 'Firebase'
pod 'Firebase/AdMob'
pod 'Firebase/Auth'
pod 'Firebase/Crash'
pod 'Firebase/Database'
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
pod 'Firebase/RemoteConfig'
pod 'Firebase/Storage'
# Pods for ToDoTogether
end
Make sure you are opening the workspace file and not the project file. I was receiving the same error and realized I was using the project not the workspace.
I was facing same issue and I tried multiple things but still it was not working. I tried below.
Using XCworkspace file
Cleaned the project, restarted XCode, Mac
Turned bitcode to No
Deleted the search path for Framework, Library
Finally the thing that worked is, deleting pod file and re-creating pod file. It worked as magic!
P.S.: This is very generic error and so same solution may not work for all.
Go To Project Target > Build Settings:
Look for Search Paths > Framework Search Paths, delete all paths which you have been warned; then in Library Search Paths, delete all paths which you have been warned.
For me i had to change/edit the schema and choose the new one.
I had renamed my debug schema to debug(development) and that was causing my problem.
Fix:
Product > Edit Schema > Change Build Configuration
What I did was create alternate Configurations and renamed my current one.
In my case I just had to go to Edit Scheme > Run and Reselect "None" as Executable.