flipper icon indicating copy to clipboard operation
flipper copied to clipboard

'FlipperKit/FlipperClient.h' file not found

Open HugoLiconV opened this issue 3 years ago • 11 comments

I'm getting this error while building the app using Expo:

› Compiling react-native-flipper Pods/react-native-flipper » FlipperReactNativeJavaScriptPluginManager.m

❌  (node_modules/react-native-flipper/ios/FlipperReactNativeJavaScriptPluginManager.h:12:9)

  10 | #import <React/RCTBridgeModule.h>
  11 | 
> 12 | #import <FlipperKit/FlipperClient.h>
     |         ^ 'FlipperKit/FlipperClient.h' file not found
  13 | 
  14 | NS_ASSUME_NONNULL_BEGIN
  15 | 
› Compiling react-native-flipper Pods/react-native-flipper » FlipperReactNativeJavaScriptPlugin.m

❌  (node_modules/react-native-flipper/ios/FlipperReactNativeJavaScriptPlugin.h:9:9)

   7 | 
   8 | #if defined(DEBUG) || defined(FB_SONARKIT_ENABLED)
>  9 | #import <FlipperKit/FlipperConnection.h>
     |         ^ 'FlipperKit/FlipperConnection.h' file not found
  10 | #import <FlipperKit/FlipperPlugin.h>
  11 | 
  12 | NS_ASSUME_NONNULL_BEGIN

Podfile

require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
require File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules")

require 'json'
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}

platform :ios, podfile_properties['ios.deploymentTarget'] || '12.4'
install! 'cocoapods',
  :deterministic_uuids => false

abstract_target 'common' do
  pod 'Plaid', '~> 3.1.0'
  
  use_expo_modules!
  config = use_native_modules!

  use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => flags[:hermes_enabled] || podfile_properties['expo.jsEngine'] == 'hermes',
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Dir.pwd}/.."
  )

  # Uncomment to opt-in to using Flipper
  # Note that if you have use_frameworks! enabled, Flipper will not work
  #
  if !ENV['CI']
    use_flipper!({ 'Flipper' => '0.174.0' })
  end

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

    # This is necessary for Xcode 14, because it signs resource bundles by default
    # when building for devices.
    installer.target_installation_results.pod_target_installation_results
      .each do |pod_name, target_installation_result|
      target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
        resource_bundle_target.build_configurations.each do |config|
          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
    end
  end

  post_integrate do |installer|
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
  end

  target 'App' do
  end

  target 'App-dev' do
  end

  target 'App-preview' do
  end

  target 'App-staging' do
  end
end

I set up Flipper using this expo tutorial.

I followed this and it didn't worked

Environment

expo: 46.0.16 react: 18.0.0 react-native: 0.69.6 react-native-flipper: 0.174.0 expo-community-flipper: 46.0.2

HugoLiconV avatar Dec 02 '22 20:12 HugoLiconV

i'm facing the same problem, any suggestions?

Screen Shot 2022-12-09 at 12 47 59 PM

delfouly avatar Dec 09 '22 10:12 delfouly

Same problem here "react": "18.1.0", "react-native": "0.70.5", "expo": "^47.0.0", "expo-community-flipper": "^47.0.0", "react-native-flipper": from "0.174.0" to "0.176.1",

Buk1m avatar Dec 16 '22 19:12 Buk1m

Ok so I accidentally removed the line: "plugins": ["expo-community-flipper"] from app.json

after adding this line back everything works.

Here is the step in expo docs: https://docs.expo.dev/guides/using-flipper/#step-4-add-the-config-plugin

make sure that plugins key is nested within expo: {}

Buk1m avatar Dec 16 '22 19:12 Buk1m

Had a similar issue in bare React-Native app in Xcode 14 after upgrading to "react-native-flipper": "^0.176.0". Downgrading fixed it.

jensdev avatar Jan 03 '23 09:01 jensdev

make sure that plugins key is nested within expo: {}

Thanks @Buk1m , Expo: please update the docs so this is clear!

fkranenburg avatar Jan 07 '23 14:01 fkranenburg

This occurs for us when we have the following added to our plugins array:

      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ],

We're stuck in a loop since we need "useFrameworks": "static" for react-native-firebase.

conoremclaughlin avatar Jan 12 '23 08:01 conoremclaughlin

We're stuck in a loop since we need "useFrameworks": "static" for react-native-firebase.

If you want to keep Flipper for now you can use react-native-firebase 14.x, it's only 15+ that need use_frameworks.

liamjones avatar Jan 12 '23 08:01 liamjones

Did anybody find a solution for this? Also created a stack overflow post.

hraschan avatar Feb 21 '23 12:02 hraschan

Same problem here.

Need to use react-native-firebase.

Same error

redareda9 avatar Mar 04 '23 10:03 redareda9

Any answers having the same issue with the latest expo :/

adnaneghalem avatar Mar 09 '23 10:03 adnaneghalem

I don't use firebase and don't need to use_frameworks, still after following the official docs of integrating flipper, it gives me the same error. There is no way I know of to use both firebase v15 and flipper. Anyway, I have no idea what expo does in the background after setting it up (according to docs), but I noticed that there is no FlipperKit installed after running pod install. What worked for me was modifying the podfile's use_react_native part by adding flipper configuration, so now it looks like this:

use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes',
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/..",

    # Uncomment to opt-in to using Flipper
    # Note that if you have use_frameworks! enabled, Flipper will not work
    :flipper_configuration => !ENV['CI'] ? FlipperConfiguration.enabled(["Debug"], { 'Flipper' => '0.184.0' }) : FlipperConfiguration.disabled,
  )

I also commented out the use_frameworks line just to be safe, even thought I think it's not needed if you don't specify to you static frameworks in app.json

I see you have useFlipper(...) in your podfile, I do not have that, just this. I grabbed this config from my bare RN project. I think that the useFlipper(...) you have should also work (used to have that in other projects), but it changes so often I really don't know. Is FlipperKit mentioned in your podfile.lock?

CptFabulouso avatar Mar 14 '23 09:03 CptFabulouso

Had a similar issue in bare React-Native app in Xcode 14 after upgrading to "react-native-flipper": "^0.176.0". Downgrading fixed it.

Downgraded to what version please?

highviewstudios avatar Mar 22 '23 18:03 highviewstudios

UP

gldkru avatar Mar 28 '23 17:03 gldkru

update react-native.config.js like this

module.exports = { assets: ['./assets/fonts'], dependencies: { ...(process.env.NO_FLIPPER ? {'react-native-flipper': {platforms: {ios: null}}} : {}), }, };

then run "NO_FLIPPER=1 npx pod-install"

mk0116 avatar Jul 11 '23 10:07 mk0116

Gah, I'm getting the same issue. I follow the expo example for building for a local device. boo

thoth-seshat avatar Aug 04 '23 22:08 thoth-seshat

@HugoLiconV i added this: pod 'FlipperKit', '~> 0.167.0' into my pod file and my app build was succeessful

guisszo avatar Aug 12 '23 23:08 guisszo

update react-native.config.js like this

module.exports = { assets: ['./assets/fonts'], dependencies: { ...(process.env.NO_FLIPPER ? {'react-native-flipper': {platforms: {ios: null}}} : {}), }, };

then run "NO_FLIPPER=1 npx pod-install"

this worked for me, thanks

RaguRam1991 avatar Sep 05 '23 13:09 RaguRam1991

update react-native.config.js like this

module.exports = { assets: ['./assets/fonts'], dependencies: { ...(process.env.NO_FLIPPER ? {'react-native-flipper': {platforms: {ios: null}}} : {}), }, };

then run "NO_FLIPPER=1 npx pod-install"

This worked for me! Thanks @mk0116

bjoxiah avatar Nov 22 '23 13:11 bjoxiah