wizpanda / cordova-plugin-firebase-lib

This repository is moving & merging to https://github.com/wizpanda/cordova-plugin-firebase-lib to avoid confusion to developers.
https://www.wizpanda.com/
MIT License
68 stars 38 forks source link

fatal error: 'Firebase.h' file not found during building ios platform #36

Closed matthieup240 closed 4 years ago

matthieup240 commented 5 years ago

Describe the bug

fatal error: 'Firebase.h' file not found during building ios platform

Hello,

I trying to build the IOS platform but get this fatal error about firebase.h file.

Did you already get this kind of error ?

Thanks

Here is my ionic info :

Ionic:

Ionic CLI : 5.2.1 (/usr/local/lib/node_modules/ionic) Ionic Framework : ionic1 1.3.1 @ionic/v1-toolkit : 1.0.22

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1) Cordova Platforms : android 8.0.0, ios 5.0.1 Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 22 other plugins)

Utility:

cordova-res : 0.3.0 (update available: 0.5.1) native-run : not installed

System:

Android SDK Tools : 26.1.1 (/Library/Android/sdk/) ios-deploy : 1.9.4 ios-sim : 8.0.1 NodeJS : v11.9.0 (/usr/local/Cellar/node/11.9.0/bin/node) npm : 6.5.0 OS : macOS Mojave Xcode : Xcode 10.2.1 Build version 10E1001

torsorensen commented 4 years ago

TL;DR: Are you using v.5.x of this plugin and using the .xcodeproj file? In this case, you should be using the .xcworkspace file since Cocoa Pods require this.

In my case, this error msg didn't show when I manually built my project via Xcode 10.1 (10B61) using the .xcworkspace file.

However, when I use my fastlane setup, the error popped up towards the end. Here's the relevant context in my case.

While building module 'Firebase' imported from /...path.../Plugins/cordova-plugin-firebase-lib/FirebasePlugin.m:4:
In file included from <module-includes>:1:
/...path.../platforms/ios/Pods/Headers/Public/Firebase/Firebase.h:1:9: fatal error: 'FirebaseCore/FirebaseCore.h' file not found
#import <FirebaseCore/FirebaseCore.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
/...path.../Plugins/cordova-plugin-firebase-lib/FirebasePlugin.m:4:9: fatal error: could not build module 'Firebase'
#import "Firebase.h"
 ~~~~~~~^~~~~~~~~~~~
2 errors generated.

Fix In my case, I knew something with my Fastlane configuration was suddenly wrong since I could manually build and export the IPA file through Xcode. When going over my Fastfile, specifically my usage of gym(), I realised I was using the .xcodeproj file to refer to my project and not the .xcworkspace file. I changed the gym config, and it worked.

When working with Cocoa pods (used in v.5.x of this plugin), the use of .xcworkspace is required. This is also mentioned in the docs of this library.

If you are building your app using Xcode, please open platform/ios/my-cordova-project.xcworkspace instead of platform/ios/my-cordova-project.xcodeproj so that the Xcode can load both Cordova app & the Pods (https://github.com/wizpanda/cordova-plugin-firebase-lib#cocoapods)

Changing it worked for me!

sagrawal31 commented 4 years ago

@tux240 are you still having this issue?

matthieup240 commented 4 years ago

No, I resolved it by opening the project with the .xcworkspace file !

sagrawal31 commented 4 years ago

Great! I’m closing this.