Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6: 'Answers.h' file not found after Fabric Crashlytics update

I was working along in my storyboard in Xcode 6.3.2 on an Objective-C project. All of a sudden when I try to build I get an error:

/.../Developer/ProjectName/Crashlytics.framework/Headers/Crashlytics.h:14:9: 'Answers.h' file not found

I've had Crashlytics installed and working in my app for a few weeks. I have it running through the Fabric plugin. I switched over the the Fabric app and noticed it had recently updated Crashlytics.

In Xcode if I go "Source Control" -> "Commit..." to look at my changes, it only shows the changes I made - which are unrelated to Crashlytics.

Is anyone else seeing this? Anyone have suggestions on the most efficient way to recover and get back to work?

I'm just a bit frustrated having no control when a dependency updates.

UPDATE:

To get the project to a build-able state so that I can keep working, I temporarily removed the following lines from my AppDelegate:

  • #import <Crashlytics/Crashlytics.h>
  • [Fabric with:@[CrashlyticsKit]];
like image 666
davew Avatar asked Aug 13 '15 17:08

davew


3 Answers

I ended up reaching support via the "Contact support" link at http://support.crashlytics.com/.

They provided me some steps to remove the old Crashlytics framework from my project and then reinstall it manually. It wasn't clear to me that he intended that I remove the framework via Finder instead of Xcode, so my attempt to follow the instructions resulted in a number of side affects (eg framework ended up in the wrong directory, I had a nameless folder on my desktop from a ditto command he had me run...this caused Time Machine to mysteriously stop working until I deleted the folder).

I ended up completely removing Fabric and Crashlytics from the project, and then I used the Fabric OSX app to install Crashlytics back into the project. From here the project was working again.

To remove Crashlytics and Fabric from the project, I did the following:

  1. Deleted Crashlytics.framework and Fabric.framework from my project via Xcode
  2. Deleted the run script in Project properties -> Build Phases. This may be optional. It's important to verify though that the unique id in the run script matches what Fabric provides upon reinstall.
  3. Deleted the following 3 lines in the AppDelegate. This may be optional. It will need to be replaced upon reinstall.

    #import <Fabric/Fabric.h>
    #import <Crashlytics/Crashlytics.h>
    
    [Fabric with:@[CrashlyticsKit]];
    
like image 111
davew Avatar answered Nov 11 '22 22:11

davew


For me, I was following the Fabric.app's steps which told me to include #import <Answers/Answers.h> but all I needed was:

#import <Crashlytics/Crashlytics.h>

...

[Answers logCustomEventWithName:@"My First Custom Event"
                  customAttributes:@{}];
like image 26
Genki Avatar answered Nov 11 '22 22:11

Genki


If you are using Crashlytics+Answer try this:

#import <Crashlytics/Crashlytics.h> //Obj-C
import Crashlytics                  //Swift
like image 33
Mohammad Zaid Pathan Avatar answered Nov 11 '22 22:11

Mohammad Zaid Pathan