Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: FlipperKit header files not found #478

Closed
kuhnroyal opened this issue Jul 4, 2019 · 19 comments
Closed

Question: FlipperKit header files not found #478

kuhnroyal opened this issue Jul 4, 2019 · 19 comments
Assignees

Comments

@kuhnroyal
Copy link

Trying to follow the getting started for iOS from the website, I always end up with this error.
'FBDefines/FBDefines.h' file not found when trying to build my project in XCode.
The file is in this repository but not in my locally built pod.
I am using use_frameworks! and uncommented everything related.

I tried versions 0.22.0 and 0.21.1
Swift 5

Any ideas what I am doing wrong?

@kuhnroyal
Copy link
Author

This might have to do something with header/framework search paths.
So if someone has a working Swift example with . use_frameworks!, that would probably help.

@kuhnroyal
Copy link
Author

I have used the changes from this comment: #254 (comment) which fixed static linking for OpenSSL.

Looking at the headers generated by CocoaPods, FBDefines/FBDefines.h is actually in FlipperKit/FBDefines.h - if I change this, the error goes away but other missing headers appear.

I would really appreciate some input on how to get Flipper to work or if this is even supported.
The changes from #254 (comment) are also missing from the documentation.

@kuhnroyal kuhnroyal changed the title Question: 'FBDefines/FBDefines.h' file not found Question: FlipperKit header files not found Aug 9, 2019
@priteshrnandgaonkar priteshrnandgaonkar self-assigned this Aug 16, 2019
@felislynx-silae
Copy link

For me more headers are not found, this is quite frustrating that flipper is not working with use_frameworks! :/

@priteshrnandgaonkar
Copy link
Contributor

For CP 1.7+ with use_framework!, the following worked for me

  $static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly',
    'CocoaAsyncSocket', 'ComponentKit', 'DoubleConversion',
    'glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit',
    'CocoaLibEvent', 'openssl-ios-bitcode', 'boost-for-react-native']

  pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
    installer.pod_targets.each do |pod|
        if $static_framework.include?(pod.name)
          def pod.build_type;
            Pod::Target::BuildType.static_library
          end
        end
      end
  end

@priteshrnandgaonkar
Copy link
Contributor

Will update the sample and docs soon.

@priteshrnandgaonkar
Copy link
Contributor

@kuhnroyal and @felislynx-silae can you try the above solution.

@felislynx-silae
Copy link

@priteshrnandgaonkar It looks it helped, but build time is very long. Maybe putting some things like boost for react as optional might help

facebook-github-bot pushed a commit that referenced this issue Aug 20, 2019
Summary:
This PR updates the installation instruction for Cocoapods 1.7+ as the previous installation instruction was broken for the latest Cocoapods version

Solves #478 and #495

## Changelog

- Updated the Documentation
- Updated the sample app
Pull Request resolved: #522

Test Plan:
- Travis CI
- Also tested locally by building sample app.

Reviewed By: jknoxville

Differential Revision: D16902023

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 19cc01c842f93ab3565c302f8258ca88dbdecfb2
@kuhnroyal
Copy link
Author

I got further with this change but can't import FlipperClient and FlipperKitLayoutPlugin when following the setup.

        let client = FlipperClient.shared()
        let layoutDescriptorMapper = SKDescriptorMapper(defaults: ())
        FlipperKitLayoutComponentKitSupport.setUpWith(layoutDescriptorMapper)
        client?.add(FlipperKitLayoutPlugin(rootNode: application, with: layoutDescriptorMapper!))
        client?.start()

@passy
Copy link
Member

passy commented Sep 25, 2019

I'm cleaning up some old issues and this one hasn't seen updates in a long time. Please let me know if this is still a problem and we can reopen it. Thanks!

@hannojg
Copy link

hannojg commented Apr 5, 2020

Hey, the solution proposed by @priteshrnandgaonkar didn't work, please reopen @passy

In the podfile it is written:
Note that if you have use_frameworks! enabled, Flipper will not work....

How are we supposed to get it working with use_frameworks ?

@AppKidd
Copy link

AppKidd commented Jan 21, 2021

For anyone finding this in the future... Flipper does now document how to define Pods whilst using use_frameworks: https://fbflipper.com/docs/getting-started/ios-native/

project 'MyApp.xcodeproj'
flipperkit_version = '0.49.0'

target 'MyApp' do
  platform :ios, '9.0'

  # .......

  # If you use `use_frameworks!` in your Podfile,
  # uncomment the below $static_framework array and also
  # the pre_install section.  This will cause Flipper and
  # it's dependencies to be built as a static library and all other pods to
  # be dynamic.
  #
  # NOTE Doing this may lead to a broken build if any of these are also
  #      transitive dependencies of other dependencies and are expected
  #      to be built as frameworks.
  #
  # $static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly',
  #   'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion',
  #   'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit',
  #   'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native']
  #
  # pre_install do |installer|
  #   Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
  #   installer.pod_targets.each do |pod|
  #       if $static_framework.include?(pod.name)
  #         def pod.build_type;
  #           Pod::BuildType.static_library
  #         end
  #       end
  #     end
  # end
end

@ghasemikasra39
Copy link

For anyone finding this in the future... Flipper does now document how to define Pods whilst using use_frameworks: https://fbflipper.com/docs/getting-started/ios-native/

project 'MyApp.xcodeproj'
flipperkit_version = '0.49.0'

target 'MyApp' do
  platform :ios, '9.0'

  # .......

  # If you use `use_frameworks!` in your Podfile,
  # uncomment the below $static_framework array and also
  # the pre_install section.  This will cause Flipper and
  # it's dependencies to be built as a static library and all other pods to
  # be dynamic.
  #
  # NOTE Doing this may lead to a broken build if any of these are also
  #      transitive dependencies of other dependencies and are expected
  #      to be built as frameworks.
  #
  # $static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly',
  #   'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion',
  #   'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit',
  #   'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native']
  #
  # pre_install do |installer|
  #   Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
  #   installer.pod_targets.each do |pod|
  #       if $static_framework.include?(pod.name)
  #         def pod.build_type;
  #           Pod::BuildType.static_library
  #         end
  #       end
  #     end
  # end
end

What about react native?

@zhuzhiyongai
Copy link

static_library

$static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly',
'CocoaAsyncSocket', 'ComponentKit', 'DoubleConversion',
'glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit',
'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native']

pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if $static_framework.include?(pod.name)
def Pod::BuildType;
Pod::Target::BuildType.static_library
end
end
end
end

@thliu21
Copy link

thliu21 commented Jan 11, 2022

Hello folks. I am encountering this issue again as I am getting
'FBDefines/FBDefines.h' file not found
while using use_frameworks!.
I tried what @kuhnroyal mentioned by changing the path to FlipperKit/FBDefines.h but it revealed more issues like this. I think there is something definitely wrong with my podfile but I cannot find out where. Could anyone help me out?

@karthik-balasubramanyam15

I'm using Flipper 0.152.0, both manual & automatic config, yields iOS build failure - 'FBDefines/FBDefines.h' file not found. Is there anything specific I can do to resolve the issue? I have tried all the above solutions but no dice. Any help is much appreciated.

@billnbell
Copy link

usually you can add it to podspec the include.

@Muhammad-Sufian
Copy link

https://stackoverflow.com/questions/73894220/flipperkit-flipperclient-h-file-not-found
this resolved issue for me

@kdpadhiyar
Copy link

But what steps solved?
@Muhammad-Sufian

I am facing same issue as @kuhnroyal is asked to resolve.
@kuhnroyal Are you able to solve that issue?

@kuhnroyal
Copy link
Author

Yes, I moved to Flutter a long time ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests