Undefined symbols for architecture x86_64 in Xcode

2019-06-15 01:12发布

I updated FirebaseUI to the newest version, and that updated TwitterCore 3.0.0 (was 2.8.0), ever since I get this compiler error in Xcode:

Undefined symbols for architecture x86_64:
  "_TWTRIdentifierForAdvertising", referenced from:
      +[TWTRCardConfiguration deviceID] in TwitterKit(TWTRCardConfiguration.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I currently reverted back to the previous version of TwitterCore even though it wasn't explicitly written in my Podfile. I wrote pod 'TwitterCore', '~>2.8.0'

8条回答
干净又极端
2楼-- · 2019-06-15 01:53

I have solved it by using:

# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!

target 'app name' do

#pod 'FirebaseUI'
pod 'FirebaseUI/Database'
pod 'Firebase/Storage'

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
end

So as you can see, I have commented FirebaseUI and used FirebaseUI/Database for database and Firebase/Storage for storage.

查看更多
迷人小祖宗
3楼-- · 2019-06-15 01:55

If you use it pod in testing. You must add pod in MyAppTests target.

for example:

platform :ios, '9.0'

target 'MyApp' do
  use_frameworks!

  pod 'TwitterCore', '~>3.0.0'

  target 'MyAppTests' do
    inherit! :search_paths

    pod 'TwitterCore', '~>3.0.0'

  end

end
查看更多
一夜七次
4楼-- · 2019-06-15 01:59

If you are still struggling with this error then here you go my solution. I noticed that some of above solutions don't fix the problem with Twitter package as they just remove reference to it which is not a correct approach for those people who want to deal with Twitter feature.

At the moment, FirebaseUI version is 4.1.1 and TwitterKit >= 2.4 satisfies its requirements but according to my test the latest 2.* version (which is now 2.8.1) generate error with undefined symbol reference.

I checked out that FirebaseUI 4.1.1 works just fine with earlier TwitterKit 2.7. So my solution is to just force te cocoapod to install this version.

Follow along the procedure:

1) Add these two instances to your Podfile. (you can add selectively the subspecs of FirebaseUI if you don't want to install them all).

pod 'TwitterKit' , '2.7' 

pod 'FirebaseUI', '~> 4.0'

2) Run:

pod update
查看更多
做个烂人
5楼-- · 2019-06-15 02:05

I have fixed TwitterCore >3.0.0 is problem for FirebaseUI > 3.0.0 or update pod

pod 'FirebaseUI'
pod 'TwitterCore', '<=2.8.0' # fixed

Good luck

查看更多
冷血范
6楼-- · 2019-06-15 02:07

This would be an example of how to define the podfile version.

Exemple:

target 'Your_project' do

pod 'Firebase', '~> 1.0'

end

查看更多
神经病院院长
7楼-- · 2019-06-15 02:07

In Xcode 9, Swift 3, Firebase

-> _TWTRIdentifierForAdvertising", referenced

Thats help me:

first add in your Podfile: pod 'FirebaseUI', '~> 4.0'

after: pod update

查看更多
登录 后发表回答