React-native: Included GLog.podspec broken on case sensitive file system

Created on 3 Oct 2017  路  12Comments  路  Source: facebook/react-native

Resolution

Fixed in 0.54, update your podfile:

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

Original Bug Report

Is this a bug report?

yes

Have you read the Contributing Guidelines?

yes

Environment

Environment:
OS: macOS High Sierra 10.13
Node: 8.6.0
Yarn: 1.1.0
npm: 5.3.0
Watchman: 4.9.0
Xcode: Xcode 9.0 Build version 9A235
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: ^0.48.2 => 0.48.3

Target Platform: iOS (10.3)

Steps to Reproduce

  1. Place your the source of your react-native based project on a case sensitive file system on macOS (HFS+ or APFS).
  2. Manage your dependencies using cocoapods instead of react-native link.

Here is a minimal Podfile:

platform :ios, '10.3'
inhibit_all_warnings!

target 'MyiOSProject' do
  # React dependencies
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  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'

  # React and its submodules
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',
    'DevSupport',
    'RCTPushNotification',
    'RCTText',
    'RCTImage',
    'RCTAnimation',
    'RCTNetwork'
  ]
end
  1. pod install

  2. Try to build the resulting xcworkspace using Xcode.

Expected Behavior

When opening the xcworkspace and press build it should build without errors.

Actual Behavior

I get a build error saying .../Pods/Folly/folly/Range.h:33:10: 'glog/logging.h' file not found

screen shot 2017-10-03 at 12 56 07

How to fix

Just fix your supplied GLog.podspec to have spec.name = 'glog' instead of spec.name = 'GLog'. The name of the library is glog not GLog. Because of this misspelling cocoapods names the subdirectory in the Headers folder wrongly and therefore the inclusion error on case sensitive systems.

iOS Fixed Locked

Most helpful comment

If you are using React Native <0.54, you will get the following error:

# "The name of the given podspec GLog doesn't match the expected one glog"
# Use the following line instead:
#pod 'GLog', :podspec => "#{rn_path}/third-party-podspecs/GLog.podspec"

All 12 comments

Anyone want to send a PR for this?

@athei could you please try my fork? you can install it using this line in your package.json:

"react-native": "git+ssh://[email protected]:maxkomarychev/react-native#glog-folly-case"

important keep in mind this fork is based on tag 0.50.3

and then modify your Podfile to:

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

Hi
I am facing the same issue. I have tried everything and wasted last 3 days
Please help me!!!!

Not fixed as of [email protected] , very annoying

I addressed this here: https://github.com/facebook/react-native/pull/17476/files#diff-cf374a993404a1abd4a5d4972c6f87caR13

I think this is a lower-impact fix.

Would this be worth splitting out into its own PR?
Edit: https://github.com/facebook/react-native/pull/17476 has been merged, should fix this.

This is fixed in [email protected]
Update your Podfile to:
pod 'glog', :podspec => 'node_modules/react-native/third-party-podspecs/glog.podspec'

This has been fixed and docs are also updated, but updated docs are not reflected on the react-native docs website.

Anyone want to send a PR to fix the docs? https://github.com/facebook/react-native-website

Disregard. The docs are already up to date, @simonbengtsson updated master three weeks ago: http://facebook.github.io/react-native/docs/next/integration-with-existing-apps.html

I've updated the 0.54 version to include this as well.

This problem has been fixed at 0.54.4v. I noticed today.

If you are using React Native <0.54, you will get the following error:

# "The name of the given podspec GLog doesn't match the expected one glog"
# Use the following line instead:
#pod 'GLog', :podspec => "#{rn_path}/third-party-podspecs/GLog.podspec"

I get this issue in RN: 0.55.4 and fixed it by:

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

despairblue picture despairblue  路  3Comments

josev55 picture josev55  路  3Comments

DreySkee picture DreySkee  路  3Comments

phongyewtong picture phongyewtong  路  3Comments

anchetaWern picture anchetaWern  路  3Comments