Cocoapods - Flurry & TestFlight - Undefined symbols for architecture

…衆ロ難τιáo~ 提交于 2019-12-02 19:08:20

The following worked for me:

In the Build Settings, do not override "Other Linker Flags". If it is bold, select it and press backspace, it should be back to its normal state. If it is not fixed, delete all flags, remove and reinstall Pods and that should fix it.

Cocoapods, for some reason, doesn't include libTestFlight.a in the TestFlight target. So to fix this issue, each time you run pod install, you must:

  1. Open the Pods-TestFlightSDK target in the Pods.xcodeproj project
  2. Open Build Phases tab
  3. Add (via "Add Other...") libTestFlight.a to Link Binary With Libraries dropdown

libTestFlight.a can be found in your [$SRCROOT]/Pods/TestFlightsSDK folder.

Do the same with Flurry and you're good to go!

Update May 1st 2014

It looks like "missing library integration" is a symptom of using the --no-integrate flag (e.g., pod install --no-integrate).

And to make life easier, I've written a script to automatically add the libraries after running pod (update|install) --no-integrate

Adjust as necessary and add this to the bottom of your Podfile:

# Use post_install to automatically include required libraries
post_install do |installer_representation|
    installer_representation.project.targets.each do |target|
        if target.name == 'Pods-TestFlightSDK'
            libFile = installer_representation.project.new_file('TestFlightSDK/libTestFlight.a')
        end

        if target.name == 'Pods-Brightcove-Player-SDK'
            libFile = installer_representation.project.new_file('Brightcove-Player-SDK/Library/libBCOVPlayerSDK.a')
        end

        unless libFile.nil?
            puts "    - Adding %s to %s Frameworks Build Phases" % [libFile, target.name]
            target.frameworks_build_phase.add_file_reference(libFile)
        end
    end
end

I've found that can be few reasons of this issue:

  1. libPod.a not included in "link binary with libraries" (try to remove reference and add again)
  2. Compiler can't find library. Strange behaviour, try to write path to libraries using ${PODS_ROOT} at "Library search path". ($(PODS_ROOT)/TestFlightSDK for example)
  3. Compiler can't find header. try to write path to headers using ${PODS_ROOT} at "Header search path".

Hope that this is helpful.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!