22

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

Cœur
  • 37,241
  • 25
  • 195
  • 267
bob
  • 466
  • 1
  • 7
  • 27

9 Answers9

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.

cit
  • 2,465
  • 5
  • 28
  • 36
Hamid Hoseini
  • 1,560
  • 17
  • 21
  • 1
    Mine problem solved after running the application through ".xcworkspace" instead of ".xcodeproj" – Abuzar Manzoor Feb 21 '18 at 10:55
  • 4
    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. – A1ucard Feb 23 '18 at 00:57
  • 1
    sir i have already i used xcworkspace but not working for me tell m any other way to fix above error? – Kapil Soni Apr 02 '19 at 12:59
  • 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. – Hamid Hoseini Apr 08 '19 at 23:52
  • @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. – Kapil Soni Apr 09 '19 at 06:58
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.

Sukendh
  • 103
  • 1
  • 6
  • 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? – Abdullah Nurum Feb 25 '18 at 03:15
4

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

Vincent Mungai
  • 202
  • 3
  • 4
2

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

Renaming them will fix this error.

Nadine
  • 559
  • 2
  • 15
  • how do I know which file is identical? – Yusuf Khan Mar 16 '19 at 15:45
  • @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). – Nadine Mar 21 '19 at 20:54
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.

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.

Frostmourne
  • 156
  • 1
  • 19
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
Pavel Bogart
  • 405
  • 5
  • 16
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.

AEQ
  • 1,339
  • 1
  • 16
  • 20
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.

Pingolin
  • 3,161
  • 6
  • 25
  • 40
Ravi
  • 165
  • 3
  • 11