23

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.

enter image description here

9
  • Are you running the xcworkspace project file? If yes, try to restart Xcode and then clean your project before running it. Commented Sep 8, 2017 at 11:46
  • No, I'm not. the guide said to simply close xcode then instal pods but now i'm thinking about I remember you have to open a new project file created by pods right? Commented Sep 8, 2017 at 11:47
  • Yes you do to be able to access the pod files. Try it and let me know if it works for you. Commented Sep 8, 2017 at 11:48
  • Try to add pod 'Firebase' to your pod file and reinstall pod after that. Commented Sep 8, 2017 at 11:54
  • 2
    Check my first comment to restart Xcode :) But good that it´s working. Commented Sep 8, 2017 at 12:21

9 Answers 9

64

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.

Sign up to request clarification or add additional context in comments.

5 Comments

Mine problem solved after running the application through ".xcworkspace" instead of ".xcodeproj"
For those who don't know how to build workspace instead of xcode project, here is the step. Open your xcode project in FINDER and the project contains ".xcworkspace" and ".xcodeproj", double click .xcworkspace file to open. That's it.
sir i have already i used xcworkspace but not working for me tell m any other way to fix above error?
Hi @Kapilsoni, hope your issue has been fixed. There is nothing that I can add here. I just suggest one more time to review your steps to see if there is something missing.
@HamidHoseini yes sir my issue has been fixed but after change build setting to legacy build system then after clean and archive error is gone.
7

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.

1 Comment

are you talking about in one class or different class? If one class we cannot have object with same name. If different class how come it affect each other?
4

I faced the same problem for hours and solved it with a simple hack. Just do clean and then Build

Comments

2

This error will also trigger when several components (files) with identical names were added to Xcode workspace.

Renaming them will fix this error.

2 Comments

how do I know which file is identical?
@YusufKhan In my case, I had import duplicates. You can start simply by opening the files tree in the Xcode' workspace and see if you have identical files (some of them might be highlighted in red if missing).
2

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.

Comments

1

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.

Comments

1

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

Comments

0

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.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.