Skip to content

Third party podspecs should only include required files #14654

@david50407

Description

@david50407
**Issues that do not describe a bug or do not fill out the template below will be closed**

We use GitHub Issues exclusively for tracking bugs in React Native.

Reporting bugs

Want to report a bug? Please read the bug reporting guidelines: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#bugs

Description

Use React Native with CocoaPods. But all #include <math.h> (Like Yoga.h) throw a warning and go to find Math.h from Folly and caused #include <limits> not found (in this issue facebook/folly#617 )

Reproduction Steps

Init react native project and use CocoaPods with Podfile:

source 'https://github.com/CocoaPods/Specs.git'

  platform :ios, '8.0'
  use_frameworks!

  REACT_NATIVE = '../node_modules/react-native'

  target 'Skyyer' do
    pod "Yoga", path: "#{REACT_NATIVE}/ReactCommon/yoga"
    pod 'DoubleConversion', podspec: "#{REACT_NATIVE}/third-party-podspecs/DoubleConversion.podspec"
    pod 'GLog', podspec: "#{REACT_NATIVE}/third-party-podspecs/GLog.podspec"
    pod 'Folly', podspec: "#{REACT_NATIVE}/third-party-podspecs/Folly.podspec"
    pod 'React', path: REACT_NATIVE, subspecs: %w(
      Core
      CxxBridge
      DevSupport
      RCTActionSheet
      RCTGeolocation
      RCTImage
      RCTLinkingIOS
      RCTNetwork
      RCTSettings
      RCTText
      RCTVibration
      RCTWebSocket
    )
end

Then build iOS project.

Solution

Create a new React Native project and compare the default project without pods to with pods.
Then exclude the files which is not listed in the default project from Folly.podspec.
After only includes necessary files, the build passed

Additional Information

  • React Native version: 0.45.1
  • Platform: iOS
  • Development Operating System: macOS
  • Build tools: XCode

Files from default project I included finally:

2017-06-21 17 41 21

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions