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

[0.50.0] PrivateDatabase.{cpp,h} not included in Podspec #16663

Closed
notjosh opened this issue Nov 3, 2017 · 0 comments
Closed

[0.50.0] PrivateDatabase.{cpp,h} not included in Podspec #16663

notjosh opened this issue Nov 3, 2017 · 0 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@notjosh
Copy link
Contributor

notjosh commented Nov 3, 2017

Is this a bug report?

Yes.

Have you read the Contributing Guidelines?

Yes.

Environment

$ ./node_modules/.bin/react-native info
Scanning folders for symlinks in /Users/joshua/dev/native-navigation/node_modules (9ms)

Environment:
  OS:  macOS High Sierra 10.13.1
  Node:  8.9.0
  Yarn:  1.3.2
  npm:  5.5.1
  Watchman:  4.9.0
  Xcode:  Xcode 9.1 Build version 9B55
  Android Studio:  3.0 AI-171.4408382

Packages: (wanted => installed)
  react: 16.0.0 => 16.0.0
  react-native: 0.50.0 => 0.50.0

Steps to Reproduce

  1. upgrade npm/yarn to RN 0.50.0
  2. re-run (bundle exec) pod install to link everything back together with 0.50.0
  3. (if necessary, resolve any additional header-related build issues: [RN 0.49-rc.5] Fishhook error #16039, [iOS][cocoapods] 'RCTAnimation/RCTValueAnimatedNode.h' file not found #13198)
  4. build project in Xcode (9.1, fwiw)

My Podfile uses these pods, in case it matters:

  ROOT = '../..'.freeze
  REACT_NATIVE = File.join(ROOT, 'node_modules/react-native').freeze
  THIRD_PARTY = File.join(REACT_NATIVE, 'third-party-podspecs').freeze

  pod 'native-navigation', :path => ROOT
  pod 'yoga', :path => File.join(REACT_NATIVE, 'ReactCommon/yoga').freeze

  pod 'DoubleConversion', :podspec => File.join(THIRD_PARTY, 'DoubleConversion.podspec').freeze
  pod 'Folly', :podspec => File.join(THIRD_PARTY, 'Folly.podspec').freeze
  pod 'GLog', :podspec => File.join(THIRD_PARTY, 'GLog.podspec').freeze

  pod 'React', :path => REACT_NATIVE, :subspecs => %w(
    Core
    CxxBridge
    DevSupport
    RCTAnimation
    RCTImage
    RCTNetwork
    RCTText
    RCTWebSocket
  )

Expected Behavior

Build should work

Actual Behavior

Build failure, with error:

Undefined symbols for architecture x86_64:
  "typeinfo for facebook::react::PrivateDataBase", referenced from:
      std::__1::enable_if<std::is_base_of<facebook::react::PrivateDataBase, facebook::react::JSCExecutor>::value, facebook::react::JSCExecutor>::type* facebook::react::PrivateDataBase::tryCast<facebook::react::JSCExecutor>(void*) in JSCExecutor.o
      typeinfo for facebook::react::JSCExecutor in JSCExecutor.o
      std::__1::enable_if<std::is_base_of<facebook::react::PrivateDataBase, facebook::react::(anonymous namespace)::JSFunctionPrivateData>::value, facebook::react::(anonymous namespace)::JSFunctionPrivateData>::type* facebook::react::PrivateDataBase::tryCast<facebook::react::(anonymous namespace)::JSFunctionPrivateData>(void*) in JSCHelpers.o
      typeinfo for facebook::react::(anonymous namespace)::JSFunctionPrivateData in JSCHelpers.o
  "vtable for facebook::react::PrivateDataBase", referenced from:
      facebook::react::PrivateDataBase::PrivateDataBase() in JSCExecutor.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "facebook::react::PrivateDataBase::~PrivateDataBase()", referenced from:
      facebook::react::JSCExecutor::JSCExecutor(std::__1::shared_ptr<facebook::react::ExecutorDelegate>, std::__1::shared_ptr<facebook::react::MessageQueueThread>, folly::dynamic const&) in JSCExecutor.o
      facebook::react::JSCExecutor::~JSCExecutor() in JSCExecutor.o
      facebook::react::(anonymous namespace)::JSFunctionPrivateData::~JSFunctionPrivateData() in JSCHelpers.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Solution

I was able to resolve the issue by adding another section to the React.podspec:

s.subspec "PrivateDatabase" do |ss|
  ss.source_files         = "ReactCommon/privatedata/*.{cpp,h}"
  ss.private_header_files = "ReactCommon/privatedata/*.h"
end

and then adding that to my Podfile.

I'll create a PR with a fix: I think adding PrivateDatabase as a dependency for jschelpers should solve the issue implicitly. But would like to use this issue to track it, in case there are any other issues as a result.

@notjosh notjosh changed the title PrivateDatabase.{cpp,h} not included in Podspec [0.50.0] PrivateDatabase.{cpp,h} not included in Podspec Nov 3, 2017
ide pushed a commit that referenced this issue Nov 4, 2017
Summary:
Resolves #16663.

Walked through the reproduction steps in #16663, but with successful build.

We can also now see the files are included in the `Pods` project:

<img width="236" alt="screen shot 2017-11-03 at 7 43 21 pm" src="https://user-images.githubusercontent.com/33126/32390596-4a06c05c-c0cf-11e7-8616-3ae547f8cca2.png">

(I noticed a subspec called `_ignore_me_subspec_for_linting_` so do we have tests for the podspec?)

[IOS] [BUGFIX] [React.podspec] - Resolves build error about missing symbols for PrivateDatabase.{cpp,h}
Closes #16664

Differential Revision: D6238178

Pulled By: hramos

fbshipit-source-id: b57007ab8c7c8bd0faf1f2f11269a7a2c28183e5
ide pushed a commit that referenced this issue Nov 4, 2017
Summary:
Resolves #16663.

Walked through the reproduction steps in #16663, but with successful build.

We can also now see the files are included in the `Pods` project:

<img width="236" alt="screen shot 2017-11-03 at 7 43 21 pm" src="https://user-images.githubusercontent.com/33126/32390596-4a06c05c-c0cf-11e7-8616-3ae547f8cca2.png">

(I noticed a subspec called `_ignore_me_subspec_for_linting_` so do we have tests for the podspec?)

[IOS] [BUGFIX] [React.podspec] - Resolves build error about missing symbols for PrivateDatabase.{cpp,h}
Closes #16664

Differential Revision: D6238178

Pulled By: hramos

fbshipit-source-id: b57007ab8c7c8bd0faf1f2f11269a7a2c28183e5
@facebook facebook locked as resolved and limited conversation to collaborators Nov 3, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Nov 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants