corymsmith / react-native-fabric

A React Native library for Fabric, Crashlytics and Answers
MIT License
1.31k stars 236 forks source link

[IOS] 'Fabric/Fabric.h' file not found #164

Closed ozgurrgul closed 6 years ago

ozgurrgul commented 6 years ago

When I build, I'm getting this error:

'Fabric/Fabric.h' file not found in AppDelegate.m

Can anyone instruct me to how to install Fabric & Crashlytics? I'm having hard time to integrate it because I didn't use Xcode much.

What I've done:

I'm not using Pods.

c100k commented 6 years ago

Have you added

#import <Fabric/Fabric.h>
#import <Crashlytics/Crashlytics.h>

on top of your AppDelegate.m ?

ozgurrgul commented 6 years ago

Yes.

On Jan 31, 2018 5:31 PM, "Chafik" notifications@github.com wrote:

Have you added

import <Fabric/Fabric.h>

import <Crashlytics/Crashlytics.h>

on top of your AppDelegate.m ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/corymsmith/react-native-fabric/issues/164#issuecomment-361967967, or mute the thread https://github.com/notifications/unsubscribe-auth/ATKpCAVNeVKzTQGpCQt22hfHHtBOUhNHks5tQIc5gaJpZM4RyU65 .

rudyryk commented 6 years ago

Try to install Fabric into your project with an app https://fabric.io/downloads/xcode

This is not react-native-fabric issue but rather XCode project configuration one, react-native link doesn't provide complete project configuration (and not supposed to do in this case).

rudyryk commented 6 years ago

Downloaded and extracted Crashlytics & Fabric project to my project root folder

This is not enough, frameworks should be properly added to XCode project, so it could find libs and headers.

sircEUNHO commented 6 years ago

Fix this, just add ${SRCROOT}/Crashlytics on your framework searchpath

rahamin1 commented 5 years ago

@sircEUNHO @rudyryk @jatarga @c100k If any of you can help, I will be grateful

I am struggling for the last 3 days with Crashlytics setup... Need help from somebody who did it...

I followed the instructions in https://fabric.io/kits/ios/crashlytics/install, as following:

  1. Added the kit to podile, ran pod install
  2. Added a run script build phase. The instructions say to add "${PODS_ROOT}/Fabric/run" and the long key. What did you specify for ${PODS_ROOT}? An absolute path? A relative path? I searched for the Fabric folder. It is under node_modules/react-native/React, but there is no run script/file in this folder. Do you have such a file?
  3. I am runing Xcode 10, and the instructions said to add an input file (to the run script) as well. I assume that this is the path to podfile, right? Did you use an absolute path? Relative?
  4. Added the API key to info.plist. Seems clear.
  5. Added #import <Fabric/Fabric.h> to AppDelegate.m (the instructions say to add it to AppDelegate.swift, but since I didn't find this file, I saw somewhere that the actual file is AppDelegate.m. I am getting, in the editor, the message Fabric/Fabric.h not found. I saw in SO (https://stackoverflow.com/questions/29923807/fatal-error-fabric-fabric-h-file-not-found) that I need to configure Teamcity, which I don't have installed at all. Do you use it?

@rudyryk I tried to install Crashlytics from https://fabric.io/downloads/xcode. After download, I chose the project and a spinner was displayed. I expected it to stop, but it didn't. There was a message along this spinner saying 'run build'... Build still fails, obviously (since I have that error in AppDelegate.m).

@sircEUNHO You write "Fix this, just add ${SRCROOT}/Crashlytics on your framework searchpath". Where exactly did you add it?

As I wrote above any help will be appreciated. I am stuck :(

magick93 commented 5 years ago

@corymsmith - why did you close this?

lucasff commented 5 years ago

I have the exact same issue

robwalkerco commented 5 years ago

I was encountering this issue, and the only thing that finally sorted it was by removing the automatically created links in 'Build Phases - Link Binary with Libraries' and re-adding the links manually myself. This triggered the 'Build Settings - Framework Search Paths' option to be created.

kyle-ssg commented 4 years ago

Just in case this helps someone, I was receiving this in AppCenter due to using an outdated version of Xcode, moving from 10.1 to 11 solved this for me.