React-native-fcm: Include of non-modular header inside framework module 'FirebaseAnalytics'

Created on 7 Oct 2016  路  15Comments  路  Source: evollu/react-native-fcm

Now getting this error when trying to build this project. I did not check in the pods as they were over 100MB, but did checkin the podfile and lock.

https://github.com/tarr11/fcm_bug

While building module 'FirebaseAnalytics' imported from /Users/douglastarr/dev/rntest/node_modules/react-native-fcm/ios/RNFIRMessaging.h:4:
In file included from <module-includes>:1:
In file included from ../../../ios/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h:5:
../../../ios/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h:1:9: error: include of non-modular header inside framework module 'FirebaseAnalytics' [-Werror,-Wnon-modular-include-in-framework-module]
#import <FirebaseCore/FIRAnalyticsConfiguration.h>
        ^
While building module 'FirebaseAnalytics' imported from /Users/douglastarr/dev/rntest/node_modules/react-native-fcm/ios/RNFIRMessaging.h:4:
In file included from <module-includes>:1:
In file included from ../../../ios/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h:6:
../../../ios/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h:1:9: error: include of non-modular header inside framework module 'FirebaseAnalytics' [-Werror,-Wnon-modular-include-in-framework-module]
#import <FirebaseCore/FIRApp.h>
        ^
While building module 'FirebaseAnalytics' imported from /Users/douglastarr/dev/rntest/node_modules/react-native-fcm/ios/RNFIRMessaging.h:4:
In file included from <module-includes>:1:
In file included from ../../../ios/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h:7:
../../../ios/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h:1:9: error: include of non-modular header inside framework module 'FirebaseAnalytics' [-Werror,-Wnon-modular-include-in-framework-module]
#import <FirebaseCore/FIRConfiguration.h>
        ^
While building module 'FirebaseAnalytics' imported from /Users/douglastarr/dev/rntest/node_modules/react-native-fcm/ios/RNFIRMessaging.h:4:
In file included from <module-includes>:1:
In file included from ../../../ios/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h:9:
../../../ios/Pods/FirebaseAnalytics/Frameworks/frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h:1:9: error: include of non-modular header inside framework module 'FirebaseAnalytics' [-Werror,-Wnon-modular-include-in-framework-module]
#import <FirebaseCore/FIROptions.h>
        ^
4 errors generated.
In file included from /Users/douglastarr/dev/rntest/node_modules/react-native-fcm/ios/RNFIRMesssaging.m:1:
/Users/douglastarr/dev/rntest/node_modules/react-native-fcm/ios/RNFIRMessaging.h:4:9: fatal error: could not build module 'FirebaseAnalytics'
@import FirebaseAnalytics;
 ~~~~~~~^~~~~~~~~~~~~~~~~
5 errors generated.

Most helpful comment

didi anyone managed to solve this? I'm having the same issue but with react-native-firebase

All 15 comments

I fixed this by uncomment the "use_framework!" line in the podfile.

I will add this to readme

This is not a viable solution, since it can break other pods.

This does, in fact, break other pods, as @btoueg pointed out.
Here is one : https://github.com/transistorsoft/react-native-background-geolocation/issues/174

so much problem...perhaps I will switch back to look for .h file rather than module.

I am still facing this issue. How can I fix this? It's been more than 2 weeks I am stuck at this error. Help would be appreciated. Pods version: 1.4 Firebase: 4.9.0

While building module 'Firebase' imported from /Users/vishal/ezyyyy/node_modules/react-native-fcm/ios/RNFIRMessaging.h:4:
In file included from <module-includes>:1:
../../../ios/Pods/Firebase/Core/Sources/Firebase.h:1:9: fatal error: 'FirebaseAnalytics/FirebaseAnalytics.h' file not found
#import <FirebaseAnalytics/FirebaseAnalytics.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/vishal/ezyyyy/node_modules/react-native-fcm/ios/RNFIRMessaging.m:1:
/Users/vishal/ezyyyy/node_modules/react-native-fcm/ios/RNFIRMessaging.h:4:9: fatal error: could not build module 'Firebase'
#import "Firebase.h"
 ~~~~~~~^~~~~~~~~~~~
2 errors generated.

Can you provide the content of your app's Podfile?

I have the same issue :
```While building module 'Firebase' imported from /React_Native/newSmoc/SMOC/node_modules/react-native-fcm/ios/RNFIRMessaging.h:4:
In file included from :1:
../../../ios/Pods/Firebase/Core/Sources/Firebase.h:1:9: fatal error: 'FirebaseAnalytics/FirebaseAnalytics.h' file not found

import

    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from /React_Native/newSmoc/SMOC/node_modules/react-native-fcm/ios/RNFIRMessaging.m:1:
/React_Native/newSmoc/SMOC/node_modules/react-native-fcm/ios/RNFIRMessaging.h:4:9: fatal error: could not build module 'Firebase'

import "Firebase.h"

~^~~~~~
2 errors generated.
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
```

Podfile has nothing except :
use_frameworks!
pod 'Firebase/Messaging'

Ok, looks like you've just started using cocoapods: are you opening the newly generated .xcworkspace file with XCode?

PS: please format your code

Yes i am opening from the .xcworkspace
what i meant by podfile has nothing is that i dont have any other pods

Getting the same issue since i added use_framework in my project (because of another deps).
Not sure how to workaround this problem since I am unfamiliar with pod (react-native context, so javascript dev)

try comment out use_frameworks!

I must use it, another dep use swift.

@MoOx try v14.0.0

didi anyone managed to solve this? I'm having the same issue but with react-native-firebase

Was this page helpful?
0 / 5 - 0 ratings