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

'FlipperKit/FlipperClient.h' file not found #4351

Open
HugoLiconV opened this issue Dec 2, 2022 · 18 comments
Open

'FlipperKit/FlipperClient.h' file not found #4351

HugoLiconV opened this issue Dec 2, 2022 · 18 comments

Comments

@HugoLiconV
Copy link

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

@delfouly
Copy link

delfouly commented Dec 9, 2022

i'm facing the same problem, any suggestions?

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

@Buk1m
Copy link

Buk1m commented Dec 16, 2022

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
Copy link

Buk1m commented Dec 16, 2022

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: {}

@jensdev
Copy link

jensdev commented Jan 3, 2023

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

@fkranenburg
Copy link

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

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

@conoremclaughlin
Copy link

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.

@liamjones
Copy link
Contributor

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.

@hraschan
Copy link

hraschan commented Feb 21, 2023

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

@redareda9
Copy link

Same problem here.

Need to use react-native-firebase.

Same error

@adnaneghalem
Copy link

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

@CptFabulouso
Copy link

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?

@highviewstudios
Copy link

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?

@gldkru
Copy link

gldkru commented Mar 28, 2023

UP

@mk0116
Copy link

mk0116 commented Jul 11, 2023

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"

@thoth-seshat
Copy link

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

@guisszo
Copy link

guisszo commented Aug 12, 2023

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

@RaguRam1991
Copy link

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

@bjoxiah
Copy link

bjoxiah commented Nov 22, 2023

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

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