flipper: Flipper integration with cocoapod use_frameworks! cannot compile

🐛 Bug Report

My ios swift project uses several dynamics frameworks so use_frameworks! is mandatory. Unfortunately the official steps here doesn’t seem to be working.

I tried to debug this but this happens even in an empty project, where the only pods are Flipper itself.

Any help or suggestion to fix this issue? Thanks in advance.

To Reproduce

Here’s a sample project: https://github.com/andikapratama/flipper_use_framework_example run pod install open the workspace project and build. compile will fail

Environment

MacOS Big Sur 11.1 XCode 12.5 Cocoapod 1.10.1

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 27
  • Comments: 16 (5 by maintainers)

Most upvoted comments

Hello folks. I encountered this issue and I tried a few things. There is one thing that I tried and it fixed the problem. I am no expert on cocoapods or flipper, but I got it build by just adding Flipper-Fmt to the $static_framework.

    $static_framework = [ ..., 'Flipper-Fmt']

It is yet to know how this works out and I am in a my-code-works-but-I-dunno-why situation. If you are a cocoapods expert please help me digging a bit.

I can’t believe this issue is still open. React Native team knows it’s an issue but just says to disable flipper, says that Flipper team needs to fix it. With hermes you pretty much need Flipper now. Why isn’t this a higher priority?

cc @lblasa any idea why use_frameworks! causes issues? Adding it to iOS/Sample/Podfile indeed results in

[!] The 'Pods-Sample' target has transitive dependencies that include statically linked binaries: (Flipper-Boost-iOSX and Flipper-RSocket)

Hello folks. I encountered this issue and I tried a few things. There is one thing that I tried and it fixed the problem. I am no expert on cocoapods or flipper, but I got it build by just adding Flipper-Fmt to the $static_framework.

    $static_framework = [ ..., 'Flipper-Fmt']

It is yet to know how this works out and I am in a my-code-works-but-I-dunno-why situation. If you are a cocoapods expert please help me digging a bit.

Oh, I tried with Flipper latest version 127 and It’s worked, Maybe Flipper-folly has fixed it, 🥳 🥳 🥳 🥳 🥳

It seems that Flipper-Boost-iOSX has not been fixed yet.

[!] The 'Pods-xxx' target has transitive dependencies that include statically linked binaries: (Flipper-Boost-iOSX)

Please help us solve this problem. Our develop team thinks it’s very important and useful. 😭😭😭

0.98.0 still this error

@martintreurnicht FYI, I know it doesn’t fix the immediate issue, the intention is for Flipper integration not to be on by default in future and Hermes debugging to occur via Chrome DevTools (while the code still runs inside Hermes). More info here: https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0641-decoupling-flipper-from-react-native-core.md

Hello folks. I encountered this issue and I tried a few things. There is one thing that I tried and it fixed the problem. I am no expert on cocoapods or flipper, but I got it build by just adding Flipper-Fmt to the $static_framework.

    $static_framework = [ ..., 'Flipper-Fmt']

It is yet to know how this works out and I am in a my-code-works-but-I-dunno-why situation. If you are a cocoapods expert please help me digging a bit.

Oh, I tried with Flipper latest version 127 and It’s worked, Maybe Flipper-folly has fixed it, 🥳 🥳 🥳 🥳 🥳

I downgraded Flipper to 0.87.0 and installed Flipper-Folly by specifying local pod spec file then this problem was solved.

This is flipper part of my Podfile:

    pod 'FlipperKit',  :configuration => 'pro-debug'
    pod 'FlipperKit/SKIOSNetworkPlugin',  :configuration => 'pro-debug'
    pod 'Flipper-Folly', :podspec => '${yourProject}/Component/LocalPods/Specs/Flipper-Folly.podspec.json',  :configuration => 'pro-debug'
    pod 'CocoaLibEvent', :configuration => 'pro-debug'
    pod 'boost-for-react-native', :configuration => 'pro-debug'
    pod 'OpenSSL-Universal', :configuration => 'pro-debug'

 
    $static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly',
      'CocoaAsyncSocket', 'ComponentKit','Flipper-Fmt', 'Flipper-DoubleConversion',
      'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit',
      'CocoaLibEvent', 'OpenSSL-Universal', 'Flipper-Boost-iOSX']
      
      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

The local pod spec json file is :

{
  "name": "Flipper-Folly",
  "version": "2.5.3",
  "license": {
    "type": "Apache License, Version 2.0"
  },
  "homepage": "https://github.com/facebook/folly",
  "summary": "An open-source C++ library developed and used at Facebook.",
  "authors": "Facebook",
  "source": {
    "git": "https://github.com/priteshrnandgaonkar/folly.git",
    "tag": "v2020.04.06.01"
  },
  "module_name": "folly",
  "dependencies": {
    "boost-for-react-native": [

    ],
    "Flipper-Glog": [

    ],
    "Flipper-DoubleConversion": [

    ],
    "OpenSSL-Universal": [
      "1.0.2.20"
    ],
    "libevent": [
      "~> 2.1.12"
    ]
  },
  "compiler_flags": "-DFOLLY_HAVE_PTHREAD=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_LIBGFLAGS=0 -DFOLLY_HAVE_LIBJEMALLOC=0 -DFOLLY_HAVE_PREADV=0 -DFOLLY_HAVE_PWRITEV=0 -DFOLLY_HAVE_TFO=0 -DFOLLY_USE_SYMBOLIZER=0\n    -frtti\n    -fexceptions\n    -std=c++14\n    -Wno-error\n    -Wno-unused-local-typedefs\n    -Wno-unused-variable\n    -Wno-sign-compare\n    -Wno-comment\n    -Wno-return-type\n    -Wno-global-constructors",
  "source_files": [
    "folly/*.h",
    "folly/concurrency/*.h",
    "folly/container/*.h",
    "folly/container/detail/*.h",
    "folly/detail/*.h",
    "folly/executors/**/*.h",
    "folly/experimental/*.h",
    "folly/functional/*.h",
    "folly/futures/*.h",
    "folly/futures/detail/*.h",
    "folly/gen/*.h",
    "folly/hash/*.h",
    "folly/hash/detail/*.h",
    "folly/init/*.h",
    "folly/io/*.h",
    "folly/io/async/*.h",
    "folly/io/async/ssl/*.h",
    "folly/lang/*.h",
    "folly/memory/*.h",
    "folly/memory/detail/*.h",
    "folly/net/*.h",
    "folly/net/detail/*.h",
    "folly/portability/*.h",
    "folly/ssl/*.h",
    "folly/ssl/detail/*.h",
    "folly/synchronization/*.h",
    "folly/synchronization/detail/*.h",
    "folly/system/*.h",
    "folly/tracing/*.h",
    "folly/chrono/*.h",
    "folly/*.cpp",
    "folly/concurrency/*.cpp",
    "folly/container/detail/*.cpp",
    "folly/detail/*.cpp",
    "folly/executors/*.cpp",
    "folly/experimental/hazptr/*.cpp",
    "folly/futures/*.cpp",
    "folly/futures/detail/*.cpp",
    "folly/hash/*.cpp",
    "folly/io/*.cpp",
    "folly/io/async/*.cpp",
    "folly/io/async/ssl/*.cpp",
    "folly/lang/*.cpp",
    "folly/memory/*.cpp",
    "folly/memory/detail/*.cpp",
    "folly/net/*.cpp",
    "folly/portability/*.cpp",
    "folly/ssl/*.cpp",
    "folly/ssl/detail/*.cpp",
    "folly/String.cpp",
    "folly/synchronization/*.cpp",
    "folly/system/*.cpp"
  ],
  "exclude_files": [
    "folly/synchronization/Rcu.cpp",
    "folly/synchronization/Rcu.h"
  ],
  "header_mappings_dir": "folly",
  "header_dir": "folly",
  "libraries": "stdc++",
  "public_header_files": "folly/**/*.h",
  "pod_target_xcconfig": {
    "USE_HEADERMAP": "NO",
    "CLANG_CXX_LANGUAGE_STANDARD": "c++11",
    "HEADER_SEARCH_PATHS": "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Flipper-DoubleConversion\" \"$(PODS_ROOT)/libevent/include\""
  },
  "platforms": {
    "ios": "10.0"
  }
}



In addition, do not use “use_modular_headers!” if you write “use_frameworks!” in Podfile.

I am also getting compile time errors if use "use_frameworks! ". I want to use Flipper in a project that have mix of swift and objective c. I followed all the steps mentioned in https://fbflipper.com/docs/getting-started/ios-native/

Xcode - 13.0 beta 4 Mac OS - Big Sur 11.5

Error 1- /Users/dipakpandey/Desktop/FlipperDemo/Pods/Target Support Files/Pods-FlipperDemo/Pods-FlipperDemo-dummy.m:1:9: while building module ‘Foundation’ imported from /Users/dipakpandey/Desktop/FlipperDemo/Pods/Target Support Files/Pods-FlipperDemo/Pods-FlipperDemo-dummy.m:1:

Error 2- /Users/dipakpandey/Desktop/FlipperDemo/Pods/Target Support Files/Pods-FlipperDemo/Pods-FlipperDemo-dummy.m:1:9: while building module ‘Foundation’ imported from /Users/dipakpandey/Desktop/FlipperDemo/Pods/Target Support Files/Pods-FlipperDemo/Pods-FlipperDemo-dummy.m:1:

Screenshot 2021-08-31 at 10 51 24 AM

It probably helps if you include the actual error you are getting. It also helps people searching for the error:

/Users/andres/Documents/Projects/flippertest/Pods/Flipper-Fmt/include/fmt/locale.h:11:10: fatal error: 'locale' file not found
#include <locale>
         ^~~~~~~~
1 error generated.