Flipper: iOS Swift Integration - Search Paths and Flags not getting setup

Created on 14 Dec 2018  路  4Comments  路  Source: facebook/flipper

After following the documented setup steps on a single page swift application and setting up the pods, after importing FlipperKit and then initialize FlipperClient: let client = FlipperClient() Xcode will not be able to find FlipperClient, after searching high and low and comparing to the swift sample project I found that the below Xcode settings are set in your sample project but integrating your Pod does not cause these to be added or noted that they need to be added

HEADER_SEARCH_PATHS, OTHER_CPLUSPLUSFLAGS, OTHER_LDFLAGS, & OTHER_SWIFT_FLAGS

Am I missing something?

Most helpful comment

Also to get these pods to work in a project that use dynamic frameworks, here is some code to force Flipper to stay static

$static_framework = ['FlipperKit', 'Flipper', 'Folly', 
    'CocoaAsyncSocket', 'ComponentKit', 'DoubleConversion', 
    'glog', 'PeerTalk', 'RSocket', 'Yoga', 'YogaKit', 
    'CocoaLibEvent', 'OpenSSL-Static', 'boost-for-react-native']
pre_install do |installer|
    installer.pod_targets.each do |pod|
        if $static_framework.include?(pod.name)
            pod.host_requires_frameworks = false
        end
    end
end

All 4 comments

HEADER_SEARCH_PATHS should match with sample app. I just checked that the cocoapod doesn't automatically add -DFB_SONARKIT_ENABLED flag which is required in OTHER_CPLUSPLUSFLAGS, OTHER_LDFLAGS, & OTHER_SWIFT_FLAGS. I will look into it and update the podspec. Thanks for reporting the issue.

Also to get these pods to work in a project that use dynamic frameworks, here is some code to force Flipper to stay static

$static_framework = ['FlipperKit', 'Flipper', 'Folly', 
    'CocoaAsyncSocket', 'ComponentKit', 'DoubleConversion', 
    'glog', 'PeerTalk', 'RSocket', 'Yoga', 'YogaKit', 
    'CocoaLibEvent', 'OpenSSL-Static', 'boost-for-react-native']
pre_install do |installer|
    installer.pod_targets.each do |pod|
        if $static_framework.include?(pod.name)
            pod.host_requires_frameworks = false
        end
    end
end

Can you add this in docs ?

Closing the issue as it is resolved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

justintuchek picture justintuchek  路  3Comments

bojankoma picture bojankoma  路  4Comments

usrbowe picture usrbowe  路  3Comments

hsavit1 picture hsavit1  路  3Comments

ramakula picture ramakula  路  4Comments