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

Flipper: gflags.h not found #10

Closed
KDederichs opened this issue Mar 26, 2020 · 16 comments
Closed

Flipper: gflags.h not found #10

KDederichs opened this issue Mar 26, 2020 · 16 comments

Comments

@KDederichs
Copy link

Environment

System:
    OS: macOS 10.15.3
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 7.26 GB / 64.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 23, 24, 25, 26, 27, 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-29 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 11.4/11E146 - /usr/bin/xcodebuild
  Languages:
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0 
    react-native: 0.62.0 => 0.62.0 
  npmGlobalPackages:
    *react-native*: Not Found

Upgrading version

From 0.61.5 to 0.62.0

Description

After updating manually to 0.62.0 (the update helper flat-out refused to work) I got the problem that upon compiling Xcode complains that it can't find the gflags/gflags.h include in Flipper-Glog.
Is there any manual linking/search path editing that has to be done in order for flipper to find Glog?

@lucasbento
Copy link
Member

@KDederichs can you please provide a minimal project to reproduce your issue? Without that it is very difficult to help you out.

@KDederichs
Copy link
Author

I'm not quite sure how I'd go about that tbh.
Since I assume it's something specifically missing in my project I have no good way of reproducing it since I don't know what's missing.

@KDederichs
Copy link
Author

Actually it does that on a fresh project too @lucasbento
Just did fresh app to see if that works and it's the same problem

@KDederichs
Copy link
Author

In fact everything I do now results in that....
Even checking out the branch that's still on 0.61.5

@lucasbento
Copy link
Member

@KDederichs which CocoaPods version are you using? you can check that by running pod --version

@KDederichs
Copy link
Author

@lucasbento Version 1.9.1

@KDederichs
Copy link
Author

I already tried:

Cleaning the Xcode build
Deleting Xcode DerivedData
Deleting the Pods folder
Deleting the Pods cache
Deleting node_modules
Switching between legacy and new build system

result is always the same:
/ios/Pods/glog/src/glog/logging.h:86:10: fatal error: 'gflags/gflags.h' file not found

@pvinis
Copy link
Member

pvinis commented Mar 27, 2020

What does your Podfile and Podfile.lock look like?

@KDederichs
Copy link
Author

@pvinis

Podfile:

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

def add_flipper_pods!
  version = '~> 0.33.1'
  pod 'FlipperKit', version, :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutPlugin', version, :configuration => 'Debug'
  pod 'FlipperKit/SKIOSNetworkPlugin', version, :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitUserDefaultsPlugin', version, :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitReactPlugin', version, :configuration => 'Debug'
end

# Post Install processing for Flipper
def flipper_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'YogaKit'
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '4.1'
      end
    end
  end
end

target 'PROJECT_NAME' do
  # Pods for PROJECT_NAME
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  use_native_modules!

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  add_flipper_pods!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

Podfile.lock:
https://pastebin.com/awiNQV2b

That's after the 62 update, before that just the same minus the flipper stuff and the Yoga and callinvoker change

@KDederichs
Copy link
Author

I think it might not execute the iOS-install-third-party.sh script if that helps.
Don't know if it's supposed to execute that during builds

@KDederichs
Copy link
Author

OK....
Turns out I picked up some brew package that installed gflags causing the pod to be installed as enabled with it.
After removing the brew version of gflags it works again.

Question now is it that a bug I should mention in the main repo or is it an intended feature?

@rickhanlonii
Copy link

cc @alloy @passy

@passy
Copy link

passy commented Mar 27, 2020

cc @priteshrnandgaonkar

@alloy
Copy link
Member

alloy commented Mar 30, 2020

The Flipper-Glog.podspec uses an external configure script. I suspect that script is picking up the availability of gflags for macOS when it shouldn’t.

Question now is it that a bug I should mention in the main repo or is it an intended feature?

@KDederichs I would classify this as a bug in the Flipper repo.

@KDederichs
Copy link
Author

@alloy it's not only flipper, the normal RN glog does the same thing

@KDederichs
Copy link
Author

In any case I opened an issue over at facebook/react-native#28446 so I'll be closing this issue now, thanks for everyone that tried to help!

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

No branches or pull requests

6 participants