react-native-fabric: Getting "'Crashlytics/Crashlytics.h' file not found" on SMXCrashlytics.m

I’ve updated from 0.0.2 to 0.1.0, followed all steps and I’m getting the following error when trying to compile:

'Crashlytics/Crashlytics.h' file not found on line 2 in file SMXCrashlytics.m.

I have the same import in my AppDelegate.m file without any problems or error. If I go back to 0.0.2 (and removed the SMXCrashlytics library) everything works fine.

I’m using CocoaPods and that’s how Fabric and Crashlytics are installed

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 17
  • Comments: 17 (6 by maintainers)

Most upvoted comments

if you use frameworks must add this

$(SRCROOT)/…/…/…/ios/Pods/Crashlytics/iOS

in xcode project select SMXCrashlytics.xcodeproj under Libraries go to Build Settings -> Search Paths -> Framework search Paths

and add it

i had the same issue. i’m using cocoapods and fabric was installed correctly. here’s how i got it to work:

  • in xcode project select SMXCrashlytics.xcodeproj under Libraries
  • go to Build Settings -> Search Paths -> Header Search Paths
  • add $(SRCROOT)/../../../ios/Pods/Headers/Public/Crashlytics as a non-recursive path

now open your xcworkspace and it should build. your relative path might be different from mine, and maybe there’s a better way to do this.

@corymsmith thanks for the awesome module! i went ahead and made a PR in case you think this is a good change

Just 1 thing, after struggling a bit, cocoapods pod file comes with the default setting for swift it has a line 'use_frameworks!` Please comment this line for react-native as it is based of objC.

image

With latest master,i still have that error in swift project,through added it Without CocoaPods. 1~ , add pod 'Fabric' pod 'Crashlytics' in your podfile, 2~,add it‘s SMXAnswer.m/.h and SMXCrashlytics.m/.h from node_moudles to your project and choose " create folders referrences " 3~ at your target,open “Build Phrase”->“Compile Sources”,then add it‘s SMXAnswer.m/.h and SMXCrashlytics.m/.h to here. 4~still to add script,but change now: "${PODS_ROOT}/Fabric/run" XXXXX695f8a5550f932fcccc XXXX0e0e80154dc0b281405dusaek1211

you can build pretty!