Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined symbols for architecture arm64: Xcode 12

Tags:

ios

swift

xcode12

Im trying to build a project after adding 3rd party framework, however I can't compile the project after adding the framework, I get Undefined symbols for architecture arm64: error when I try to compile on a device, but I can compile on a simulator. I have tried all other solutions I found on stackoverflow. any help is appreciated!

Here is what I have tried:

  • Added Any iOS Simulator SDK with value arm64 inside Excluded Architecture.
  • I do have $(inherited) inside Other Linker Flags
  • Set Bitcode Enabled to No

None of the solutions I tried worked for me.

Undefined symbols for architecture arm64:
      "_OBJC_CLASS_$_*", referenced from:
          objc-class-ref in frameworkName.o
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
like image 705
bona912 Avatar asked Oct 06 '20 13:10

bona912


People also ask

What is undefined symbols for Architecture arm64?

Error: Undefined symbols for architecture arm64 - Sentiance. It means that framework is not included.

How do I fix undefined symbol in XCode?

The error Undefined symbols for architecture arm64: "_OBJC_CLASS_$_SKAdImpression" during the iOS build usually happens if XCode or CocoaPods version is lower than required. To fix it update XCode to 12.5 or higher and CocoaPods to 1.10. 0 or higher.

How do I fix linker error undefined symbols for Architecture arm64?

You can fix the linker error by going to project -> target (your project name) -> build settings and change architectures to standard architectures (armv7, armv7s), and valid architectures to armv7, armv7s. Note though, this means you won't get the full power of the 64 bit processor.


2 Answers

  1. "Product" -> "Scheme" -> "Edit Scheme"
  2. select "Build"
  3. Uncheck "Parallelize Build"
like image 100
Cx. Avatar answered Sep 20 '22 05:09

Cx.


Try adding this to your pod file

post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
          end
        end
    end
like image 22
Denys Avatar answered Sep 21 '22 05:09

Denys