25

After I updated Fabric Crashlytics in my app I cant anymore run it on my iOS device. On simulator it works fine. Error is:

Undefined symbols for architecture arm64: "_gzopen", referenced from: -[CLSPackageReportOperation compressFile:] in Crashlytics(CLSPackageReportOperation.o) "_gzwrite", referenced from: ___42-[CLSPackageReportOperation compressFile:]_block_invoke in Crashlytics(CLSPackageReportOperation.o) "_gzclose", referenced from: -[CLSPackageReportOperation compressFile:] in Crashlytics(CLSPackageReportOperation.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

enter image description here

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
mazorati
  • 2,031
  • 3
  • 22
  • 22

11 Answers11

50

Crashlytics and Fabric require you to link your target against the following:

  • Security.framework
  • SystemConfiguration.framework
  • libc++
  • libz

Just select your target -> Build Phases -> Link Binary with Libraries -> add the ones missing.

I hope it helped.

Ricardo Anjos
  • 1,417
  • 18
  • 22
20

I solved this issue by just adding $(inherited) to other linker flags in Build Settings.

Manfred Radlwimmer
  • 13,257
  • 13
  • 53
  • 62
sumit kapoor
  • 361
  • 3
  • 8
16

I run into a similar issue, when I was updating an app that was created before Xcode 5.

Since Xcode 5 new projects build with modules enabled by default. In my old app "Enable Modules" was set to "No". So this was the solution.

In the Build Settings set Enable Modules (C and Objective-C) to YES

coco
  • 4,912
  • 2
  • 25
  • 33
6

For me, the solution was Build Phases - Link Binary With Libraries add libc++ and works, in my legacy project.

Felipe FMMobile
  • 1,641
  • 20
  • 17
5

Solved. I removed Crashlytics.framework and reinstall it.

mazorati
  • 2,031
  • 3
  • 22
  • 22
4

My solution for this problem was:

Change "Build Active Architecture Only" to "Yes" also for "Release".

The setting can be found selecting your project > "Build Settings" > "Targets" (your target) > "Architectures"

enter image description here

do it in your project targets and also do it in your projectTest targets

enter image description here

Dey
  • 842
  • 9
  • 21
3

Extending Ricardo's answer here. Select the “Build Phases” tab, click the “+” next to “Link Binary With Libraries” and add -

  1. Security.framework
  2. SystemConfiguration.framework
  3. StoreKit.framework
  4. libsqlite3.tbd
  5. libz.tbd
  6. libc++.tbd

As per Google, developers should use Crashlytics via Firebase. This worked for me as of Firebase v5.16.0 and Fabric v1.9.0 (Xcode 10.1).

raurora
  • 3,623
  • 1
  • 22
  • 29
3

I solved the issue by adding $(inherited) $(OTHER_LDFLAGS) -ObjC -l"sqlite3" -l"z" -l"c++" -framework "Crashlytics" -framework "Fabric" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" to other linker flags in Build Settings.

Siva
  • 700
  • 6
  • 25
0

In Project(not target) Info tab set the configuration file to none and run pod install again

0

On M1 Mac

In Excluded Architectures Add "Any iOS Simulator SDK" - "arm64" in Target, Test, and all libraries you added.

enter image description here

Vettiyanakan
  • 7,957
  • 6
  • 37
  • 55
0

I solved it by removing "library which causes the error" from other linker flags.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-ask). – Community Sep 22 '21 at 01:41