skip to Main Content

There are similar questions to the one I’m asking, but they address running on simulators, not actual devices.
When I try to build and run my app on my device, I get the error

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_GMSPlacesClient", referenced from:
      objc-class-ref in BackendEngine.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The google places sdk for iOS Getting Started Page specifies using a source and targeting the pod, which I have included in my Podfile as can be seen below:

target 'TestApp' do

  use_frameworks!
  
  #source 'https://github.com/CocoaPods/Specs.git'
  source 'https://cdn.cocoapods.org/'
  pod 'GooglePlaces', '4.2.0'
  
end

The specs GitHub link is not used as a source since whenever I attempted to run it, it would hang significantly and get blocked on some commands (if I entered a keyboard interrupt, I’d always get the same traceback:

Cloning spec repo `cocoapods` from `https://github.com/CocoaPods/Specs.git`
  $ /usr/bin/git clone https://github.com/CocoaPods/Specs.git -- cocoapods
  Cloning into 'cocoapods'...
^C[!] Cancelled

[!] Automatically assigning platform `iOS` with version `14.4` on target `Cider` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Traceback (most recent call last):
    34: from /usr/local/bin/pod:23:in `<main>'
    33: from /usr/local/bin/pod:23:in `load'
    32: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
    31: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
    30: from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    29: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
    28: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'
    27: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
    26: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
    25: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
    24: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze'
    23: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    22: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
    21: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
    20: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1073:in `block in resolve_dependencies'
    19: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177:in `sources'
    18: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177:in `map'
    17: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:178:in `block in sources'
    16: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:21:in `find_or_create_source_with_url'
    15: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:46:in `create_source_with_url'
    14: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/repo/add.rb:46:in `run'
    13: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
    12: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/repo/add.rb:48:in `block in run'
    11: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/repo/add.rb:82:in `clone_repo'
    10: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/config.rb:41:in `with_changes'
     9: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/repo/add.rb:83:in `block in clone_repo'
     8: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/repo/add.rb:83:in `chdir'
     7: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/repo/add.rb:87:in `block (2 levels) in clone_repo'
     6: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/executable.rb:27:in `block in executable'
     5: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/executable.rb:67:in `execute_command'
     4: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/executable.rb:175:in `popen3'
     3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:101:in `popen3'
     2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:219:in `popen_run'
     1: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/executable.rb:180:in `block in popen3'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/executable.rb:180:in `value': Interrupt

I am new to pods and any help would be appreciated!

2

Answers


  1. Chosen as BEST ANSWER

    I ended up solving it! What was going on was that in my app, my linker flags were missing the frameworks for the GooglePlaces and GoogleMaps dependencies. I simply added

    -framework "GoogleMapsBase" -framework "GooglePlaces"

    to the "Other Linker flags" option in the Build Settings. Using the pod file described in the original question worked just fine.


    1. you pod install success?
    2. I pod GooglePlaces and success, and run success
      enter image description here
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search