cocoapodsでCrashlyticsを導入しようとしたらUndefined symbolsで怒られた

# 困ったこと

cocoapodsでCrashlyticsを導入していたら、こんなエラーが出てビルドできなくなった。

```
Undefined symbols for architecture x86_64:
  "_CLSMachOFormatVersion", referenced from:
      _CLSBinaryImageRecordMainExecutable in Crashlytics(CLSBinaryImage.o)
  "_CLSMachOGetEncrypted", referenced from:
      ___CLSBinaryImageFillInImageDetails_block_invoke in Crashlytics(CLSBinaryImage.o)
  "_CLSMachOGetLinkedSDKVersion", referenced from:
      ___CLSBinaryImageFillInImageDetails_block_invoke in Crashlytics(CLSBinaryImage.o)
  "_CLSMachOGetMinimumOSVersion", referenced from:
      ___CLSBinaryImageFillInImageDetails_block_invoke in Crashlytics(CLSBinaryImage.o)
  "_CLSMachOGetUUID", referenced from:
      ___CLSBinaryImageFillInImageDetails_block_invoke in Crashlytics(CLSBinaryImage.o)
  "_CLSMachOSliceEnumerateLoadCommands", referenced from:
      _CLSBinaryImageFillInImageDetails in Crashlytics(CLSBinaryImage.o)
  "_CLSMachOSliceGetArchitectureName", referenced from:
      _CLSBinaryImageRecordMainExecutable in Crashlytics(CLSBinaryImage.o)
  "_CLSMachOSliceGetCurrent", referenced from:
      _CLSBinaryImageRecordMainExecutable in Crashlytics(CLSBinaryImage.o)
  "_CLSMachOSliceGetExecutablePath", referenced from:
      ___CLSBinaryImageChanged_block_invoke in Crashlytics(CLSBinaryImage.o)
  "_CLSMachOSliceGetUnwindInformation", referenced from:
      _CLSBinaryImageFillInImageDetails in Crashlytics(CLSBinaryImage.o)
  "_CLSMachOSliceWithHeader", referenced from:
      _CLSBinaryImageFindImageForUUID in Crashlytics(CLSBinaryImage.o)
      _CLSBinaryImageChanged in Crashlytics(CLSBinaryImage.o)
  "_FABApplicationGetBundleIdentifier", referenced from:
      -[CLSFileManager pathNamespace] in Crashlytics(CLSFileManager.o)
      -[CLSCrashReportingController bundleIdentifier] in Crashlytics(CLSCrashReportingController.o)
      -[CLSBetaController appBundleIdentifier] in Crashlytics(CLSBetaController.o)
      +[CLSAnalyticsMetadataController bundleIdentifier] in Crashlytics(CLSAnalyticsMetadataController.o)
      ___CLSContextInitialize_block_invoke30 in Crashlytics(CLSContext.o)
  "_FABApplicationGetBundleVersion", referenced from:
      -[CLSBetaController appBuildVersion] in Crashlytics(CLSBetaController.o)
      +[CLSAnalyticsMetadataController bundleVersion] in Crashlytics(CLSAnalyticsMetadataController.o)
      ___CLSContextInitialize_block_invoke30 in Crashlytics(CLSContext.o)
  "_FABApplicationGetName", referenced from:
      -[CLSBetaUpdate promptMessage] in Crashlytics(CLSBetaUpdate.o)
  "_FABApplicationGetShortBundleVersion", referenced from:
      -[CLSBetaController appDisplayVersion] in Crashlytics(CLSBetaController.o)
      +[CLSAnalyticsMetadataController bundleShortVersion] in Crashlytics(CLSAnalyticsMetadataController.o)
      ___CLSContextInitialize_block_invoke30 in Crashlytics(CLSContext.o)
  "_FABApplicationInstallationSource", referenced from:
      +[CLSBetaController isBetaSupported] in Crashlytics(CLSBetaController.o)
      -[CLSBetaController appInstallationSource] in Crashlytics(CLSBetaController.o)
  "_FABApplicationShouldReportDeviceIdentifiers", referenced from:
      +[CLSAnalyticsMetadataController identifierForAdvertising] in Crashlytics(CLSAnalyticsMetadataController.o)
  "_FABBuiltinCertificates", referenced from:
      +[CLSBetaController pinnnedCertificates] in Crashlytics(CLSBetaController.o)
      +[CLSNetworkClient pinner] in Crashlytics(CLSNetworkClient.o)
  "_FABEnumerateByteRangesOfNSDataUsingBlock", referenced from:
      -[CLSPackageReportOperation compressFile:] in Crashlytics(CLSPackageReportOperation.o)
  "_FABHostGetOSVersion", referenced from:
      _CLSHostGetNormalizedOSVersion in Crashlytics(CLSHost.o)
  "_FABHostModelInfo", referenced from:
      ___20-[Crashlytics start]_block_invoke in Crashlytics(Crashlytics.o)
      +[CLSAnalyticsMetadataController hostModel] in Crashlytics(CLSAnalyticsMetadataController.o)
      +[CLSAnalyticsMetadataController hostMachine] in Crashlytics(CLSAnalyticsMetadataController.o)
      _CLSHostRecord in Crashlytics(CLSHost.o)
  "_FABHostOSBuildVersion", referenced from:
      ___20-[Crashlytics start]_block_invoke in Crashlytics(Crashlytics.o)
      +[CLSAnalyticsMetadataController hostOSVersion] in Crashlytics(CLSAnalyticsMetadataController.o)
      _CLSHostRecord in Crashlytics(CLSHost.o)
  "_FABHostOSDisplayVersion", referenced from:
      ___20-[Crashlytics start]_block_invoke in Crashlytics(Crashlytics.o)
      +[CLSAnalyticsMetadataController hostOSVersionName] in Crashlytics(CLSAnalyticsMetadataController.o)
      _CLSHostRecord in Crashlytics(CLSHost.o)
  "_FABNetworkMaximumRetryCount", referenced from:
      ___51-[CLSBetaController loadUpdateWithCompletionBlock:]_block_invoke in Crashlytics(CLSBetaController.o)
      -[CLSAnalyticsNetworkingClient transmitLogFilesAtURLs:toURL:withAPIKey:completionHandler:] in Crashlytics(CLSAnalyticsNetworkingClient.o)
  "_FABSettingsAvailableNotification", referenced from:
      -[CLSAnalyticsController initWithSessionIdentifier:sessionTimestamp:analyticsRootDirectoryWithURL:betaToken:identifierGenerator:timestampGenerator:metadataController:networkingClient:] in Crashlytics(CLSAnalyticsController.o)
      -[CLSBetaController start] in Crashlytics(CLSBetaController.o)
  "_OBJC_CLASS_$_CLSURLSession", referenced from:
      objc-class-ref in Crashlytics(CLSNetworkClient.o)
  "_OBJC_CLASS_$_CLSURLSessionConfiguration", referenced from:
      objc-class-ref in Crashlytics(CLSNetworkClient.o)
  "_OBJC_CLASS_$_CLSUserDefaults", referenced from:
      objc-class-ref in Crashlytics(CLSAnalyticsController.o)
  "_OBJC_CLASS_$_FABCertificatePinner", referenced from:
      objc-class-ref in Crashlytics(CLSNetworkClient.o)
  "_OBJC_CLASS_$_FABMultipartMimeStreamEncoder", referenced from:
      objc-class-ref in Crashlytics(CLSPackageReportOperation.o)
      objc-class-ref in Crashlytics(CLSReportsController.o)
      objc-class-ref in Crashlytics(CLSAnalyticsNetworkingClient.o)
  "_OBJC_CLASS_$_FABNetworkClient", referenced from:
      objc-class-ref in Crashlytics(CLSBetaController.o)
      objc-class-ref in Crashlytics(CLSAnalyticsNetworkingClient.o)
  "_OBJC_CLASS_$_FABNetworkResponseHandler", referenced from:
      objc-class-ref in Crashlytics(CLSNetworkClient.o)
  "_OBJC_CLASS_$_FABURLBuilder", referenced from:
      objc-class-ref in Crashlytics(CLSReportsController.o)
      objc-class-ref in Crashlytics(CLSBetaController.o)
  "_OBJC_CLASS_$_Fabric", referenced from:
      objc-class-ref in Crashlytics(Crashlytics.o)
      objc-class-ref in Crashlytics(CLSAnalyticsController.o)
      objc-class-ref in Crashlytics(CLSCrashReportingController.o)
      objc-class-ref in Crashlytics(CLSReportsController.o)
      objc-class-ref in Crashlytics(CLSEventLogFile.o)
      objc-class-ref in Crashlytics(CLSBetaController.o)
      objc-class-ref in Crashlytics(CLSAnalyticsMetadataController.o)
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
## 問題点と解決策

Podfileに```pod 'Crashlytics'```しか書いていなかったことが原因でした。 
```pod 'Fabric'```を追加して```pod install```しなおしたら解決しました。

ちゃんとリファレンス読みましょう。 
[Manage Fabric with CocoaPods — Fabric iOS latest documentation](https://docs.fabric.io/ios/fabric/cocoapods.html?highlight=cocoapods "Manage Fabric with CocoaPods — Fabric iOS latest documentation")

## 参考

[Error upgrading from crashlytics on iOS - Fabric / Crashlytics - Twitter Developers](https://twittercommunity.com/t/error-upgrading-from-crashlytics-on-ios/36196/13 "Error upgrading from crashlytics on iOS - Fabric / Crashlytics - Twitter Developers")