Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

error while installing Flipper-Boost-iOSX with use_frameworks! #3938

Closed
matinzd opened this issue Jul 25, 2022 · 33 comments
Closed

error while installing Flipper-Boost-iOSX with use_frameworks! #3938

matinzd opened this issue Jul 25, 2022 · 33 comments

Comments

@matinzd
Copy link

matinzd commented Jul 25, 2022

🐛 Bug Report

I know that Flipper is not compatible with use_frameworks yet but this topic will get too heated.
If we enable use_frameworks! there are some issues installing statically linked binaries:

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

Related issue: #2414

To Reproduce

  • Add use_frameworks! in podfile
  • Run pod install

Environment

  • Flipper desktop: 0.155.0
System:
    OS: macOS 12.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 26.71 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
    Yarn: 1.22.18 - ~/w/dietdoctor/rnapp/node_modules/.bin/yarn
    npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
    Watchman: 2022.05.16.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /Users/matin/.rvm/gems/ruby-3.0.2/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK:
      API Levels: 28, 29, 30, 31
      Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0, 31.0.0
      System Images: android-27 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play ARM 64 v8a, android-30 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom_64, android-31 | Google APIs Intel x86 Atom_64, android-S | Google Play Intel x86 Atom_64
      Android NDK: 23.0.7344513-beta4
  IDEs:
    Android Studio: 4.2 AI-202.7660.26.42.7351085
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.10 - /usr/local/opt/openjdk@11/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: Not Found
    react-native: Not Found
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
@baveku
Copy link
Contributor

baveku commented Jul 26, 2022

Can you show your Podfile?

@matinzd
Copy link
Author

matinzd commented Jul 28, 2022

source 'https://cdn.cocoapods.org/'
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

$RNFirebaseAnalyticsWithoutAdIdSupport = true # Disable Ad Id usage
$RNFirebaseAsStaticFramework = true

production = ENV["PRODUCTION"] == "1" || ENV['CI'] == "1"

project 'DietDoctorRN',
    'Debug-prod' => :debug,
    'Release-prod' => :release,
    'Debug-dev' => :debug,
    'Release-dev' => :release

platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false
use_frameworks!

target 'DietDoctorRN' do
  config = use_native_modules!
  
  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
      :path => config[:reactNativePath],
      :production => production,
      # to enable hermes on iOS, change `false` to `true` and then install pods
      :hermes_enabled => flags[:hermes_enabled],
      :fabric_enabled => flags[:fabric_enabled],
      :flipper_configuration => FlipperConfiguration.new(!production, ['Release-prod','Release-dev','Debug-prod', 'Debug-dev'], {}),
      # An absolute path to your application root.
      :app_path => "#{Pod::Config.instance.installation_root}/.."
  )
  pod 'KeychainSwift'

  # permission handlers for ios
  # https://github.com/zoontek/react-native-permissions
  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"

  target 'DietDoctorRNTests' do
    inherit! :complete
    # Pods for testing
  end

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

I tried your workaround in your document but that breaks the build.

@baveku

@baveku
Copy link
Contributor

baveku commented Jul 28, 2022

ReactNative doesn't support use_framework!, so You need remove it on Podfile.

@liamjones
Copy link
Contributor

ReactNative doesn't support use_framework!, so You need remove it on Podfile.

@baveku Are you sure?

facebook/react-native#34011 starts with "use_frameworks! is broken again in react-native 0.69..." which implies it worked in the past and the release notes for 0.69.1 state it should work again: https://github.com/facebook/react-native/releases/tag/v0.69.1

@liamjones
Copy link
Contributor

@matinzd you're not trying this with RN 0.69.0 by any chance are you?

@matinzd
Copy link
Author

matinzd commented Jul 28, 2022

@matinzd you're not trying this with RN 0.69.0 by any chance are you?

I am trying with 0.69.3.

ReactNative doesn't support use_framework!, so You need remove it on Podfile.

This should be fixed AFAIK but not for Flipper-Boost-iOSX. facebook/react-native@79baca6

@MCervenka
Copy link

I have the same problem with react-native 0.69.3 and firebase 15.2.0. After updating the firebase the issue arise with Flipper.

@nighttiger1990
Copy link

I got same issue with "react-native": "0.69.3", and "@react-native-firebase/app": "^15.2.0"

@Killdaneighbor187
Copy link

Looks like something suspicious to me

@TheRogue76
Copy link

Is there any progress on this issue? We need it for our app as we can't update our Firebase and RN until this is fixed

@mengshun
Copy link

mengshun commented Aug 9, 2022

I got the same problem, when i run pod install and use_frameworks!.

[!] The 'Pods-xxxx' target has transitive dependencies that include statically linked binaries: (Flipper-Boost-iOSX and Flipper-RSocket)
I try remove use_flipper!() in podfile, error disappeared.

@matinzd
Copy link
Author

matinzd commented Aug 9, 2022

I got the same problem, when i run pod install and use_frameworks!.

[!] The 'Pods-xxxx' target has transitive dependencies that include statically linked binaries: (Flipper-Boost-iOSX and Flipper-RSocket) I try remove use_flipper!() in podfile, error disappeared.

Yeah we know removing flipper can fix the issue but this needs to be fixed in Flipper.

@guiathayde
Copy link

@matinzd Did you fix this issue?

@douglassoldan
Copy link

douglassoldan commented Aug 28, 2022

use_flipper

Remove: use_frameworks!
Add: use_modular_headers!

# use_frameworks!
use_modular_headers!

Works here!

@caferyukseloglu
Copy link

https://rnfirebase.io Note use_frameworks is not compatible with Flipper. A fix was put in place in react-native release 0.69.1 that makes it work with and without Hermes. To use it with Hermes make sure you have set static linkage with use_frameworks! :linkage => :static. To use without Flipper, comment out the :flipper_configuration line in your Podfile. Community support to help fix use_frameworks support for New Architecture is welcome! Getting Error Flipper.h not found

@EnettyTech
Copy link

use_flipper

Remove: use_frameworks! Add: use_modular_headers!

# use_frameworks! use_modular_headers!

Works here!

Not work for me. issue facebook/react-native#26217

@amerllica
Copy link

remove: use_frameworks!
add: use_modular_headers!

Dear @douglassoldan, Does the above change work on RN v0.68.2? after installing Firebase stuff the flipper network plugin doesn't work anymore.

@matinzd
Copy link
Author

matinzd commented Nov 11, 2022

remove: use_frameworks!
add: use_modular_headers!

Dear @douglassoldan, Does the above change work on RN v0.68.2? after installing Firebase stuff the flipper network plugin doesn't work anymore.

For now, you can either downgrade Firebase SDK to 14.x.x or try removing incompatible modules with use_frameworks.
It depends on a project and dependencies. use_modular_headers may not work as well. So what we did was to keep Firebase SDK on 14.x.x for now and we'll upgrade it in the future when everything is fixed.

@bedirhangull
Copy link

@matinzd Which version are you using?

@oguzhandegirmen
Copy link

++

@Alobar12
Copy link

++++++

@xpt300
Copy link

xpt300 commented Dec 22, 2022

Same issue here

@tanqu2013
Copy link

+1

2 similar comments
@leonardoballand
Copy link

+1

@trickeyd
Copy link

+1

@matinzd
Copy link
Author

matinzd commented Jan 15, 2023

use_flipper

Remove: use_frameworks!

Add: use_modular_headers!

# use_frameworks!

use_modular_headers!

Works here!

That doesn't help for statically linked libraries such as react native firebase or react native video.

@xueqiulou
Copy link

xueqiulou commented Apr 19, 2023

I solved this problem with the following code in my project (react native version: 0.68.3)
1、 use_frameworks! :linkage => :static
2、rewrite the dependent library as the static_library type

use_frameworks! :linkage => :static

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

installer.pod_targets.each do |pod|
    if $static_framework.include?(pod.name)
       def pod.build_type
           Pod::BuildType.static_library
       end
    end
end

@wmonecke
Copy link

wmonecke commented Aug 4, 2023

How is this not fixed?

You are literally stuck if you use the latest Firebase and Hermes. No way to debug your API calls.

@xueqiulou you mean to put the static lib (in my case react-native-firebase) inside the $static_framework array?

@gimi-anders
Copy link

How is this not fixed?

➕ ➕ ➕ ➕

@ahmedbhd
Copy link

ahmedbhd commented Jan 8, 2024

Still got the same error with react 0.73 while following the 'AwesomeProject' tutorial, I kept retrying until it worked.

@boukelalhanane
Copy link

boukelalhanane commented Jan 10, 2024

You have to replace this use_frameworks! :linkage => linkage.to_sym and use use_frameworks! :linkage => :static,
use static linkage instead of linkage.to_sym in your podfile

@raj360
Copy link

raj360 commented Apr 2, 2024

Screenshot 2024-04-02 at 12 41 35

@amerllica
Copy link

I think this issue should be closed, Flipper doesn't exist in the React Native package anymore.

cc: @matinzd

@matinzd matinzd closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests