4

When ever I write @import FirebaseMessaging; is says -

Module 'FirebaseMessaging' not found

What I did - I install the pods with only Firebase/Core, but after that I realised Firebase/Messaging is also necessary to enable push notifications.

Sample Image

Then I wrote pod 'Firebase/Messaging' in the pod file and install the pods again.

The pod folder contains the folder as Firebase Messaging, but when I import it it says no module found.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Mukie
  • 129
  • 1
  • 2
  • 9

6 Answers6

4

You dont need to import FirebaseMessaging

Just add @import Firebase and you will get access to FIRMessaging

Piotr Golinski
  • 990
  • 8
  • 19
3

I had this issue and I could solve it this way:

if you have a framework that has Firebase/Messaging as it's dependency, and if you have set your framework's build settings to:

Build Active Architecture only
    Debug    No
    Release  No

you will get FirebaseMessaging module not found error. just try to make it like this:

Build Active Architecture only
    Debug    Yes
    Release  No
2

Had the same problem. Turns out that you need to place

use_frameworks!

in your Podfile. My Podfile now looks like this:

platform :ios, '8.4'
use_frameworks!
target 'YourTarget' do

pod 'Fabric'
pod 'Crashlytics'
pod 'Bolts'

pod 'Firebase/Core'
pod 'Firebase/Messaging'
# any other Firebase modules you need
end
ferdil
  • 1,259
  • 11
  • 24
2

You don't need to import FirebaseMessaging separately in the latest Firebase SDK according to the latest https://firebase.google.com/docs/cloud-messaging/ios/client:

@import Firebase & just include in your pod file

pod 'Firebase/Messaging'

I hope it will help.

Anil Kukadeja
  • 1,348
  • 1
  • 14
  • 27
0

If anything is not working, then you should try

  1. Comment the Firebase and FirebaseMessaging from your Podfile
  2. run pod install
  3. add following to your pod file

    pod 'Firebase', '~> 5.4'
    pod 'FirebaseMessaging', '~> 3.0'
    
  4. next is to pod install --repo-update
  5. close your project and open workspace.
  6. when you import the Firebase and try to import FirebaseMessaging, it will show you red marked lines, which means once you import Firebase it already imported the red marked modules in it.

this

Try it, if it fixes. I have tried and everything is working fine.

Bhavin Kansagara
  • 2,866
  • 1
  • 16
  • 20
-1

Please follow these process :

  1. Clean the Application from product > clean
  2. Close the Application
  3. Again Open workspace of the Application
  4. Again clean.

Hope it will help to you.Thank you.

Sanjukta
  • 1,057
  • 6
  • 16
  • Done everything. Even deleted the workspace and made a new one. Application has been closed and cleaned a lot of times but error still exist – Mukie Jul 19 '18 at 13:00