18

I just created new Framework and added Firebase via CocoaPods, when combine the library it success.

But when I add that library to other project via CocoaPods as well, then combine that project, and it raise an error: No such module 'Firebase'

Anyone faced a problem like this?

Tai Le
  • 8,530
  • 5
  • 41
  • 34
  • Can you post your podspec so we can see how you're integrating this? Also, how are you installing this in your app? Can you run `pod spec lint` on your library and post the output of that? – Mike McDonald Aug 03 '16 at 20:11
  • I am facing the same issue, do we solution for it ? – iOS_Developer Dec 31 '20 at 07:48

13 Answers13

16

You need to add the follwing to your POD file:

pod 'Firebase'

After that, you need to type in your terminal

pod install (to refresh the pod file)

Christian
  • 4,902
  • 4
  • 24
  • 42
Christian Mora
  • 177
  • 1
  • 3
  • 1
    This worked for me, I was using Xcode 10.2 and upgraded to 10.3 and Firebase needed update – Rookie Aug 10 '19 at 19:35
8

Do you open the workspace file after installed with cocoa pods ?

Check if the library is added in "Linked Frameworks" or "Embedded Binaries"

enter image description here

If it didn't work, add this pod file

platform :ios, '8.0' use_frameworks! target ‘Your Project’ do


pod 'Firebase', '>= 2.5.1'
pod ‘Firebase/Auth’
pod ‘Google/SignIn’
pod ‘Firebase/Database’
pod 'Firebase/Storage' end

and then type pod deintegrate and after that run pod install.

Han Tran
  • 2,073
  • 4
  • 22
  • 37
Bram'in
  • 618
  • 1
  • 7
  • 18
  • Click on .xcodeproj in hierarchy and try to linked the right embedded library. – Bram'in Jun 16 '16 at 07:12
  • Bad. Show me your podfile ? – Bram'in Jun 16 '16 at 09:41
  • source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! inhibit_all_warnings! target 'FirebaseAPI' do pod 'Firebase' pod 'Firebase/Core' pod 'Firebase/Crash' pod 'Firebase/Auth' pod 'Firebase/Database' end – Tai Le Jun 16 '16 at 09:58
  • Thanks a lot! The command which you mentioned should be pod deintegrate instead of pod -reintegrate – Talha Chafekar Jan 10 '21 at 10:42
8

I solve my problem using just the specific import that I'm using, for example. In my SDK I'm using FirebaseCore and FirebaseAnalytics. Into my class I just import:

import FirebaseCore
import FirebaseAnalytics

And in my .podspec I needed to set static_framework property to true, so my .podspec it's seems like code below:

s.static_framework = true

s.dependency 'Firebase'
s.dependency 'Firebase/Core'

It works for me!

Bruno Ramos
  • 149
  • 1
  • 4
6

this is the easiest solution nowadays Step 1

<XCode_Project_Folder>>General>Frameworks, Libraries, and Embedded Content: FirebaseAuth

Step 2

yhackup
  • 189
  • 2
  • 15
6

Everything was setup fine and was working before but..

My Problem:

enter image description here

What's was wrong with me?

  • I was using older name of pod, eg. - pod 'Firebase/Analytics', pod 'Firebase/Crashlytics'
  • New pod names are pod 'FirebaseAnalytics', pod 'FirebaseCrashlytics' (Problem with / ) enter image description here

Solution:

  • Use new pod name to integrate pod 'FirebaseAnalytics', pod 'FirebaseCrashlytics' (Install pod with new pod name)
  • Import import FirebaseCore, import FirebaseAnalytics instead just import Firebase
  • import FirebaseAnalytics - I'm using for log events

enter image description here

Ashvin
  • 8,227
  • 3
  • 36
  • 53
3

tried all these.. I was stuck in this situation for more than 2weeks.

finally resolved by adding "excluded architectures = arm64"

enter image description here

Energy
  • 940
  • 13
  • 20
  • 1
    Yep, that worked for me. Thanks. Btw to find this info in the project, select the project name (top line) in the navigator on the left – Kateridzhe Feb 07 '22 at 16:59
  • Thank you! I waste half of the day solving that problem! – Максим Мартынов Apr 03 '22 at 12:28
  • 1
    What does excluding arm64 do though? What other implications does it have in doing this. You may have solved the problem, but without context and documentation how do we know this won't cause other issues or have other unintended consequences? – JCutting8 Oct 17 '22 at 07:28
1

Hi today i fix same problem 1 : open podfile from xcode than add " pod 'Firebase' " save and close it 2 : open vscode or any editor using, open new terminal than write " cd ios " to open ios file than " pod install " when you install it showing problem need to add search path so now open ios file from xcode and go to : runner > target runner > build settings > all > search paths and add this " $(inherited) " into framework search path and header search path that's all

0

For me I had to change the version specified in the Podfile as it was above what my app supported. Specifically in the Podfile I changed: 'platform :ios, '11.0' to platform :ios, '10.0' which corresponds with Deployment Info in the General Tab for my app I'm working on. enter image description here

Captain Charmi
  • 583
  • 8
  • 20
0

For Flutter folks adding Firebase to their apps, make sure you follow the steps in Add Firebase to your iOS Project as well as those in the SDK setup steps in the Firebase Console:

enter image description here

In summary:

  1. Run pod init if you don't have a pod file

  2. Add the necessary pods to the bottom of the podfile. All possible Firebase pods can be found here.

    pod 'Firebase/Analytics' pod 'Firebase/Firestore' pod 'Firebase/Auth' pod 'Firebase/Storage'

  3. Run pod install

Code on the Rocks
  • 11,488
  • 3
  • 53
  • 61
0

This issue can be caused by incorrectly set-up schemes:

If you have multiple schemes (e.g. 'Dev', 'QA', 'Production' etc.) in your project, check you have the build configurations set correctly.

Further guidance in this answer here: https://stackoverflow.com/a/65453578/12322900

Then run pod deintegrate and pod install and make sure you're using the .xcworkspace file.

mintymuz
  • 262
  • 2
  • 14
0

My failure was that I downloaded modules to

  target 'YourProjectUITests' do
    # Pods for testing
       pod 'FirebaseCore'

And the right one is

  # Pods for YourProject
    pod 'FirebaseCore'

(Without UITests)

Dan
  • 1
  • 1
-1

It is because you don't have added pod dependency in Podfile.

you will find below line in Podfile

Uncomment this line to define a global platform for your project #platform :ios, '9.0'

follow the below steps.

1)just remove the # .so it will be like.

platform :ios, '9.0'

2)add the below dependencies.(Do not add all ,you just need to add whatever used in you app ,if you have used Firebase/Core only then add that line only)

#Pods for app name

pod 'Firebase'

pod 'Firebase/Core'

pod 'Firebase/Auth'

pod 'Firebase/Database'

3)clean the build

flutter clean

4)run Command :

flutter run (It will automatically adds a required pods).

that's it.

-2

The same thing happened to me last week. I solved it by:

1. pod deintegrate
2. Open Xcode and delete any instance of pod.
3. pod install
Bilbo Baggins
  • 3,644
  • 8
  • 40
  • 64