I have a rather peculiar scenario when working with Firebase in our app. Without adding Crashlytics and Fabric to the project, when I run unit tests for the project the following code is hit:
@try {
[FIRApp configure];
} @catch (NSException *exception) {
DLog(@"**** Unable to configure Firebase due to exception %@", exception.description);
}
When debugging the unit tests an exception isn't raised and so I assume firebase is configured and all is Working. Tests pass and there are no issues.
I then very simply just add Crashlytics with Fabric to the project. I add this as a run script to my build phases "${PODS_ROOT}/Fabric/run"
for the project and then run unit tests again. The unit tests fail and I get:
Terminating app due to uncaught exception 'FABException', reason: '[Fabric] Value of Info.plist key "Fabric" must be a NSDictionary.'
as an error, when I run the project however everything is fine. The issue only arises when running tests. I have tried the following:
- Add Crashlytics and Fabric to the project target and I get the same error.
- I do step 1 and also to the unit tests target and I still get the same error.
- I do step 2 and then I also add Firebase Core to the unit tests target and I still get the same error.
- I do step 3 and then also add
"${PODS_ROOT}/Fabric/run"
to a run script but on the unit tests target and still get the same error.
I think Firebase isn't being initialized correctly and this in turn causes Fabric to not be initialized correctly and hence the failure. But I'm not to sure how to fix the issue. Any guidance and suggestions would be appreciated.