Yunyuen Chan
Yunyuen Chan

Reputation: 134

['Firebase/Firebase.h' file not found]My app work on simulator but it doesn't work on my iphone 6 plus

when I use simulator to run my code, it finely works. However, when it run on my iphone 6 plus the fellowing errors occur.

enter image description here

Also these two file turn red.

enter image description here

ps.:I use Xcode 7.3 and 'Firebase', '>= 2.5.1'. All of these are latest version.

Upvotes: 4

Views: 11680

Answers (4)

Mudassar Ashraf
Mudassar Ashraf

Reputation: 972

For swift:

import Firebase

FirebaseApp.configure()

For Objective C:

@import Firebase;

[FIRApp configure];

Upvotes: 0

ehacinom
ehacinom

Reputation: 8894

I've found that including the library as a pod install directly helps dynamic libraries. For example, for Firebase:

pod 'RNFirebase', :path => 'path/to/node_modules/react-native-firebase/ios'

Changing or hardcoding HEADER_SEARCH_PATHS did not help me.

If the error ever recurs, it's not necessary to rm -rf node_modules nor delete the pod file etc - I found it useful to clear the cache.

For react-native, I run

    rm -rf $TMPDIR/react-native-packager-cache-*
    rm -rf $TMPDIR/metro-bundler-cache-*
    rm -rf $TMPDIR/metro-* 
    rm -rf $TMPDIR/react-* 
    rm -rf $TMPDIR/haste-*
    rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
    npm start -- --reset-cache

For Xcode I remove folders in ~/Library/Developer/Xcode/DerivedData

Upvotes: 0

Madhurya Gandi
Madhurya Gandi

Reputation: 892

Firebase might've not been installed in your project. Make sure you install it. Here's a link to the firebase docs.

Upvotes: 1

Cocoadelica
Cocoadelica

Reputation: 3026

Make sure you have the library linked as well as imported:

  • Go to the project file list in the left of Xcode and select the project.
  • Select the Target.
  • In the 'General' section scroll down to 'Linked Frameworks and Libraries'
  • Check if Firebase SDK is listed, if not click '+' and add it.

Upvotes: 2

Related Questions