facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.62k stars 24.29k forks source link

[iOS] RN 0.60.0-rc.2 fails to build with CocoaPods frameworks #25349

Closed jtreanor closed 5 years ago

jtreanor commented 5 years ago

The changes in 0.60.0 to integrate CocoaPods by default are causing build failures if your Podfile includes use_frameworks!. use_frameworks! is a very commonly used CocoaPods option and it is required by many pods. Prior to 0.60.0 it worked fine with the React Native podspec.

React Native version:

System:
    OS: macOS 10.14.4
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 4.86 GB / 32.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
    Yarn: 1.15.2 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    Android SDK:
      API Levels: 23, 24, 26, 27, 28
      Build Tools: 27.0.0, 27.0.3, 28.0.2, 28.0.3
      System Images: android-26 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
      Android NDK: 18.1.5063045
  IDEs:
    Android Studio: 3.4 AI-183.5429.30.34.5452501
    Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6
    react-native: 0.60.0-rc.2 => 0.60.0-rc.2

Steps To Reproduce

  1. Create a new project: react-native init AwesomeProject --version 0.60.0-rc.2.
  2. Add use_frameworks! to the top of ios/Podfile
  3. Install pods: cd ios && pod install.
  4. Build & run the app: cd .. && react-native run-ios

You will see build failures that look something like this:

▸ Compiling JSBigString.cpp

❌  /Users/james/src/tmp/AwesomeProject/ios/Pods/Folly/folly/Conv.h:38:10: 'double-conversion/double-conversion.h' file not found

#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

▸ Compiling JSBundleType.cpp
▸ Compiling MethodCall.cpp
▸ Compiling JSExecutor.cpp
▸ Compiling JSIndexedRAMBundle.cpp

❌  /Users/james/src/tmp/AwesomeProject/ios/Pods/Folly/folly/Conv.h:38:10: 'double-conversion/double-conversion.h' file not found

#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

▸ Compiling JSDeltaBundleClient.cpp

❌  /Users/james/src/tmp/AwesomeProject/ios/Pods/Folly/folly/Conv.h:38:10: 'double-conversion/double-conversion.h' file not found

#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

▸ Compiling ReactMarker.cpp
▸ Compiling React-cxxreact-dummy.m
▸ Compiling RAMBundleRegistry.cpp

❌  /Users/james/src/tmp/AwesomeProject/ios/Pods/Folly/folly/Conv.h:38:10: 'double-conversion/double-conversion.h' file not found

#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

▸ Compiling NativeToJsBridge.cpp
▸ Compiling ModuleRegistry.cpp
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening AwesomeProject.xcworkspace. Run CLI with --verbose flag for more details.
** BUILD FAILED **

The following build commands failed:
    CompileC /Users/james/src/tmp/AwesomeProject/ios/build/AwesomeProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-cxxreact.build/Objects-normal/x86_64/JSBigString.o /Users/james/src/tmp/AwesomeProject/node_modules/react-native/ReactCommon/cxxreact/JSBigString.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Describe what you expected to happen:

The app should build and run successfully.

Snack, code example, or link to a repository:

I have created a sample repository to demonstrate the issue here: https://github.com/jtreanor/react-native-cocoapods-frameworks.

Causes and fixes

I have been able to fix the error shown in the log above with some .podspec changes, but there are few more errors I haven't been able to solve. You can see my WIP react-native branch here.

michalchudziak commented 5 years ago

I've met the same issue trying to integrate 0.60-rc.2 to a native swift app with use_frameworks! enabled.

kelset commented 5 years ago

cc @orta @alloy @Salakar sorry to bother you folks, would you mind checking this issue?

jtreanor commented 5 years ago

I have been looking into this some more and I wanted to give a quick update to share what I have found.

The build error I posted in the description is easily solved by adding "$(PODS_ROOT)/DoubleConversion" to HEADER_SEARCH_PATHS of React-cxxreact, React-jsi and React-jsiexecutor.

Once I did this, I started seeing a different error:

▸ Compiling RCTImageSource.m

❌  /Users/james/src/tmp/AwesomeProject/node_modules/react-native/ReactCommon/yoga/yoga/CompactValue.h:11:10: 'cmath' file not found

#include <cmath>
           ^~~~~~~~~~~~~~~~~~~~~~~~~

❌  /Users/james/src/tmp/AwesomeProject/node_modules/react-native/React/Base/RCTConvert.h:17:9: could not build module 'yoga'

#import <yoga/Yoga.h>
         ^~~~~~~

I fixed this by setting header_files in yoga.podspec to yoga/{Yoga,YGEnums,YGMacros,YGValue}.h (reverts the change in https://github.com/facebook/react-native/commit/97e6ea13714c7741d0ba6105523cfebd6e11f963).

Next I saw this error:

▸ Linking React

❌  Undefined symbols for architecture x86_64
> Symbol: google::LogMessageFatal::LogMessageFatal(char const*, int)
> Referenced from: facebook::react::DispatchMessageQueueThread::runOnQueueSync(std::__1::function<void ()>&&) in RCTCxxUtils.o

❌  ld: symbol(s) not found for architecture x86_64

❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)

I solved this by adding React-jsi as a dependency of React-Core.

Now I saw this error:

▸ Linking React

❌  Undefined symbols for architecture x86_64
> Symbol: google::LogMessageFatal::LogMessageFatal(char const*, int)
> Referenced from: facebook::react::DispatchMessageQueueThread::runOnQueueSync(std::__1::function<void ()>&&) in RCTCxxUtils.o

❌  ld: symbol(s) not found for architecture x86_64

❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)

This was solved by adding glog as a dependency of React-Core.

Finally, I am now seeing the following error:

▸ Compiling RCTWebSocketExecutor.m

❌  /Users/james/src/tmp/AwesomeProject/node_modules/react-native/Libraries/WebSocket/RCTWebSocketExecutor.h:8:9: 'React/RCTDefines.h' file not found

#import <React/RCTDefines.h>
        ^~~~~~~~~~~~~~~~~~~~

▸ Compiling React-RCTWebSocket-dummy.m
▸ Compiling RCTReconnectingWebSocket.m

❌  /Users/james/src/tmp/AwesomeProject/node_modules/react-native/Libraries/WebSocket/RCTReconnectingWebSocket.h:8:9: 'React/RCTDefines.h' file not found

#import <React/RCTDefines.h>
        ^~~~~~~~~~~~~~~~~~~~

This is where I am stuck. It seems that #import <React/X> doesn't work for any of the Library podspecs. My guess is that this is because React/ has multiple definitions, but I don't have a very good understanding of how this works.

Update: I have been able to resolve the import error above by changing s.header_dir in the podspec. We probably don't want to do that since it would break existing includes. Anyway, when I did that, it revealed a bunch of C++ import errors:

▸ Compiling RCTWebSocketExecutor.m

❌  /Users/james/src/tmp/AwesomeProject/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSINativeModules.h:8:10: 'memory' file not found

#include <memory>
         ^~~~~~~~

❌  /Users/james/src/tmp/AwesomeProject/node_modules/react-native/ReactCommon/cxxreact/CxxModule.h:8:10: 'functional' file not found

#include <functional>
         ^~~~~~~~~~~~

❌  /Users/james/src/tmp/AwesomeProject/node_modules/react-native/ReactCommon/jsi/jsi/jsi.h:9:10: 'cassert' file not found

#include <cassert>
         ^~~~~~~~~

❌  /Users/james/src/tmp/AwesomeProject/node_modules/react-native/React/CxxBridge/JSCExecutorFactory.h:10:10: could not build module 'jsireact'

#include <jsireact/JSIExecutor.h>
 ~~~~~~~~^

❌  /Users/james/src/tmp/AwesomeProject/ios/Pods/glog/src/glog/logging.h:42:10: 'iosfwd' file not found

#include <iosfwd>
         ^~~~~~~~

❌  /Users/james/src/tmp/AwesomeProject/node_modules/react-native/Libraries/WebSocket/RCTWebSocketExecutor.h:8:9: could not build module 'React'

#import <React/RCTDefines.h>
 ~~~~~~~^
jtreanor commented 5 years ago

I am continuing to dump everything I find here. Hopefully it will be helpful for coming to a solution. I have made some more progress but I think some non-trivial changes will be needed.

I have managed to get things building, but only by adding 'DEFINES_MODULE' => 'NO' to React-Core.podspec. We definitely don't want to do this as it would break a number of things but it is a starting point. You can see my branch here.

I believe the reason for the last error in my previous comment ('memory' file not found etc.) is that React-Core now exposes C++ headers, such as JSCExecutorFactory.h. Since the module is imported by plain old Objective C headers, such as RCTWebSocketExecutor.h above, Xcode tries to build the C++ headers as ObjC and fails. This was not the case before the split as React/CxxBridge and React/Core were merged in https://github.com/facebook/react-native/pull/23559/commits/97edac1fb68b65ecee5405b96c5b4caaf52f33b7.

If I am correct about the cause here, I think there are a few options:

I would love to hear if others think I am on the right track here. I am happy to jump in with any implementation as needed. We are hoping to adopt 0.60.0 in https://github.com/wordpress-mobile/gutenberg-mobile once it is released and this is a blocker for us.

kelset commented 5 years ago

Hey @jtreanor thanks for all your work!

I've tried to raise this in the core contributors discord - but sadly I haven't got much feedback (one dev really good at iOS-fu should be back from holidays tomorrow 😅).

One of the few things I got told is that this overall issue with use_framework! was already there before, and now it's just more "visible".

And also, it seems that in most scenarios not having use_framework! leads to better performances: I know it may sound unrealistic, but have you considered shifting the problem 180deg and changing the pods that use that flag? How many pods are you relying on that have the flag? (Just for me to get an idea)

(anyway, I'll try to raise this to a few more people in the meantime)

jtreanor commented 5 years ago

Thanks for the response @kelset.

I've tried to raise this in the core contributors discord - but sadly I haven't got much feedback (one dev really good at iOS-fu should be back from holidays tomorrow 😅).

I really appreciate this!

I know it may sound unrealistic, but have you considered shifting the problem 180deg and changing the pods that use that flag? How many pods are you relying on that have the flag? (Just for me to get an idea)

Unfortunately, that's not going to be possible for us because Gutenberg, the project we are working on, is itself a pod that is written in Swift. Swift pods can only be installed with the use_frameworks! option or the use_modular_headers! option. The latter is even more broken and was not working prior to 0.60.0 either.

I don't have a good answer on the number of pods that don't support use_frameworks! but it is very quite for use_modular_headers! not to work and often we are forced to use one or the other.

After more investigation, I found a way to avoid the larger changes I suggested in my previous comment. I have opened a PR here: https://github.com/facebook/react-native/pull/25393

It's possible that changing the header_dir values and related imports will be a breaking change so I am interested in feedback on that.

jenshandersson commented 5 years ago

I will have a play, but I created a simple repo way back with Swift (without use_frameworks) and react-native using bridging header. Maybe that could be a solution. https://github.com/jenshandersson/React-Native-Swift

jtreanor commented 5 years ago

I will check that out @jenshandersson but unfortunately, I don't think it will work with 0.60+. That is the same workflow we are using and it was fine until 0.60.0.

jenshandersson commented 5 years ago

@jtreanor I got the same workflow working with 0.60.0-rc.2 just now. It might be easier to fix projects by removing use_frameworks! then by fixing RN as it's using ObjC in the core.

What pods are you using so I can test it in my repo?

jtreanor commented 5 years ago

@jenshandersson Sorry I misread your previous comment. That is a different workflow. Thanks for checking!

What pods are you using so I can test it in my repo?

As I mentioned above, in our case the problem isn't any individual pod but the fact that our project defines a podspec which depends on React. Since it is written in Swift, if I remove use_frameworks!, pod install gives me this error:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `Gutenberg` depends upon `React-Core`, `React-cxxreact`, `React-RCTAnimation`, `React-RCTImage`, `React-RCTLinking`, `React-RCTNetwork`, `React-RCTText`, `React-RCTActionSheet`, `React-DevSupport`, and `yoga`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

And if I try to solve this warning by using use_modular_headers! it gives a lot of build errors. Short of rewriting our pod in Objective C, I think either use_modular_headers! or use_frameworks! will be required.

This may be a slightly unusual use case but I do think that if React Native is going to integrate with CocoaPods, it should be compatible with most common setups, and use_frameworks! is certainly widely used.

fkgozali commented 5 years ago

Anyway, when I did that, it revealed a bunch of C++ import errors: ▸ Compiling RCTWebSocketExecutor.m ❌ /Users/james/src/tmp/AwesomeProject/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSINativeModules.h:8:10: 'memory' file not found

Usually the fix is to change the .m extension to .mm. The extension change will be needed when including the new system like fabric/turbomodule as well, so we can change it as needed.

jtreanor commented 5 years ago

Usually the fix is to change the .m extension to .mm. The extension change will be needed when including the new system like fabric/turbomodule as well, so we can change it as needed.

Yes, changing to .mm where C++ is imported is usually the way to go, but the error here isn't that RCTWebSocketExecutor.m imports a header with C++ but that the module its importing has public C++ headers so it fails to compile them, even though those headers aren't imported. That's why I fixed it by limiting public headers. Otherwise, it would not be possible to use #import <React/RCTDefines.h> or similar from an Objective C file.

MaRuifeng commented 5 years ago

We faced a very similar issue when doing cocoapod repo lint when React-cxxreact was added as a dependency together with DoubleConversion and Folly. The same error was observed during direct Xcode build.

- NOTE | xcodebuild: Folly/folly/Conv.h:38:10: fatal error: 'double-conversion/double-conversion.h' file not found

jtreanor commented 5 years ago

Oh, interesting @MaRuifeng.

Unless I'm mistaken that error should have been fixed in https://github.com/facebook/react-native/pull/25496, which is now in master.

MaRuifeng commented 5 years ago

@jtreanor Ah, we will check again. We encountered this issue a few days ago.

gdsx521 commented 5 years ago

I also encountered the same problem, I used 0.59 before, swift version is 4.2, everything is normal, but the latest version of xcode, only supports swift5.0 version, I have to upgrade my own version of the framework to swift5. 0. But at this time ReactNative0.59 has another bug. I found that I need to upgrade to the latest version of ReactNative in the discussion. When I have upgraded to ReactNative 0.60.3, I still have the bug mentioned above.

poonamdhomane commented 5 years ago

I m also facing the same issue. is any workaround for now

gdsx521 commented 5 years ago

I m also facing the same issue. is any workaround for now @_@ Can only cry dizzy in the toilet

poonamdhomane commented 5 years ago

I m also facing the same issue. is any workaround for now @_@ Can only cry dizzy in the toilet

what does it mean ?

kelset commented 5 years ago

Just for a general update, the overall work @jtreanor is doing to solve this (of which I'm super grateful 🙇‍♂️) will be released under 0.61 as it will likely involve some breaking changes.

DaniAkash commented 5 years ago

I'm using React Native simple toast library which causes the following errors after upgrading to RN 0.60.3 in XCode when I'm trying to build it:

Screenshot 2019-07-16 at 2 03 03 PM Screenshot 2019-07-16 at 2 04 53 PM

Is this case releated to this issue?

rajeshde commented 5 years ago

We faced a very similar issue when doing cocoapod repo lint when React-cxxreact was added as a dependency together with DoubleConversion and Folly. The same error was observed during direct Xcode build.

- NOTE | xcodebuild: Folly/folly/Conv.h:38:10: fatal error: 'double-conversion/double-conversion.h' file not found

Facing same issue after upgrading from 0.59.8 to 0.60.3

chinhphamnhu commented 5 years ago

[iOS] RN 0.60.3 fail to build with Cocoapods 🙇‍♂️ - OS: macOS Catalina 10.15 - XCode: 10.2.1

...
ios/Pods/Folly/folly/Conv.h:38:10: fatal error: 'double-conversion/double-conversion.h' file not found
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

** BUILD FAILED **
...
dcosmin2003 commented 5 years ago

I've updated RN from 0.59.5 to 0.60.3, changed the Podfile to follow the new format and I'm facing the same issue:

Screenshot 2019-07-18 at 10 39 44

This is my Podfile:

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

target 'DingoApp' do

  rn_path = '../node_modules/react-native'
  rn_maps_path = '../node_modules/react-native-maps'

  pod 'React', :path => "#{rn_path}"
  pod 'React-Core', :path => "#{rn_path}/React"
  pod 'React-DevSupport', :path => "#{rn_path}/React"
  pod 'React-fishhook', :path => "#{rn_path}/Libraries/fishhook"
  pod 'React-RCTActionSheet', :path => "#{rn_path}/Libraries/ActionSheetIOS"
  pod 'React-RCTAnimation', :path => "#{rn_path}/Libraries/NativeAnimation"
  pod 'React-RCTBlob', :path => "#{rn_path}/Libraries/Blob"
  pod 'React-RCTImage', :path => "#{rn_path}/Libraries/Image"
  pod 'React-RCTLinking', :path => "#{rn_path}/Libraries/LinkingIOS"
  pod 'React-RCTNetwork', :path => "#{rn_path}/Libraries/Network"
  pod 'React-RCTSettings', :path => "#{rn_path}/Libraries/Settings"
  pod 'React-RCTText', :path => "#{rn_path}/Libraries/Text"
  pod 'React-RCTVibration', :path => "#{rn_path}/Libraries/Vibration"
  pod 'React-RCTWebSocket', :path => "#{rn_path}/Libraries/WebSocket"

  pod 'React-cxxreact', :path => "#{rn_path}/ReactCommon/cxxreact"
  pod 'React-jsi', :path => "#{rn_path}/ReactCommon/jsi"
  pod 'React-jsiexecutor', :path => "#{rn_path}/ReactCommon/jsiexecutor"
  pod 'React-jsinspector', :path => "#{rn_path}/ReactCommon/jsinspector"
  pod 'yoga', :path => "#{rn_path}/ReactCommon/yoga"

  pod 'DoubleConversion', :podspec => "#{rn_path}/third-party-podspecs/DoubleConversion.podspec"
  pod 'glog', :podspec => "#{rn_path}/third-party-podspecs/glog.podspec"
  pod 'Folly', :podspec => "#{rn_path}/third-party-podspecs/Folly.podspec"

  pod 'react-native-maps', path: rn_maps_path
  pod 'react-native-google-maps', path: rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  pod 'Firebase/Core'
  pod 'Firebase/Messaging'

  pod 'lottie-ios', :path => '../node_modules/lottie-ios'

  use_native_modules!

end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == 'react-native-google-maps'
            target.build_configurations.each do |config|
                config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
            end
        end
        if target.name == "React"
            target.remove_from_project
        end
    end
end
partiellkorrekt commented 5 years ago

As a Workaround you can disable Autolinking of the modules that require use_native_modules!via the following code inside react-native.config.js in the root-folder of your react-native-project (Create this file if it doesn't exist):

module.exports = {
  dependencies: {
    'module-name': {
      platforms: {
        ios: null // disable iOS platform, other platforms will still autolink if provided
      },
      hooks: {},
      assets: [],
      params: []
    }
  }
}

(Replace module-namewith the real module name of course)

After that you can link the module manually like in old rect-native versions. You might also want to add $(SRCROOT)/../../../ios/Pods/Headers/Public with the flag recursive to the module's header search paths.

kesha-antonov commented 5 years ago

Same here with RN 0.60.4

mboettcher commented 5 years ago

I had the same error message, the solution was that firebase wasn't listed in the podfile anymore. Not sure how that was connected but I removed third-party packages from podfile before the upgrade to rn 0.60.4 because of the promised auto-linking. but had to re-link all third-party packages later again.

cantonalex commented 5 years ago

I'm using React Native simple toast library which causes the following errors after upgrading to RN 0.60.3 in XCode when I'm trying to build it:

Screenshot 2019-07-16 at 2 03 03 PM Screenshot 2019-07-16 at 2 04 53 PM

Is this case releated to this issue?

Did you solve it? I'm having the same issue.

jtreanor commented 5 years ago

@cantonalex Can you share the Podfile you are using in your project? That will help figure out what the issue you are having is.

cantonalex commented 5 years ago
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'untitled' do
  # Pods for untitled
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
  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-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

  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 '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'

  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
  pod 'Google-Mobile-Ads-SDK'

  target 'untitledTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'untitled-tvOS' do
  # Pods for untitled-tvOS

  target 'untitled-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end
jtreanor commented 5 years ago

That Podfile works for me so this doesn't seem to be related to the CocoaPods frameworks issue.

It looks like the problem is with react-native-simple-toast. It should have #import <React/RCTBridgeModule.h> rather than #import "RCTBridgeModule.h".

cantonalex commented 5 years ago

@jtreanor I don't think mine or @DaniAkash's issue is specifically CocoaPods. So maybe we're posting in the wrong thread. But it has happened in two different projects for me with two different modules. Running RN 60.

Screen Shot 2019-07-22 at 8 46 49 pm
jtreanor commented 5 years ago

Yeah, that isn't the same issue as reported here. However, it still may be a CocoaPods problem. It looks like the RN library isn't being linked in these projects and the headers aren't visible.

cantonalex commented 5 years ago

It occurs whenever I use react-native link Would love any solution. It's put me at a brick wall. Driving me nuts..

jtreanor commented 5 years ago

Opening a separate issue for the react-native link issue could be a good idea. Perhaps you would get more useful responses there.

cantonalex commented 5 years ago

https://github.com/facebook/react-native/issues/25230 may be related.

dcosmin2003 commented 5 years ago

What worked for me:

this fixed my issue, maybe it helps you.

cantonalex commented 5 years ago

@dcosmin2003 Your issue seems to be with a Cocoa-pod supported module though, mine aren't.

petrbela commented 5 years ago

@jtreanor @DaniAkash @cantonalex I'm getting the 'React/RCTConvert.h' file not found error when I clean the project and then a 3rd party library is being built before React. The solution is to turn off Parallelized builds, or build React target manually first. (Xcode should understand build dependencies to figure out build order but doesn't seem to detect is properly for RN projects.)

DaniAkash commented 5 years ago

@cantonalex Here's how I fixed mine.. I changed to XCode legacy build system and built the project once. After which I changed it to new build system and it has been working properly ever since...

jtreanor commented 5 years ago

@petrbela Is this with the latest version from master or one of the 0.60.x releases? Can you share the Podfile you are using?

petrbela commented 5 years ago

@jtreanor It's not specific to 0.60 migration but has been happening to me repeatedly in the past.

jtreanor commented 5 years ago

In that case this seems like a separate issue. This issue is only dealing with the new CocoaPods integration in 0.60

harrisrobin commented 5 years ago

I managed to successfully build after

  1. deleting derived data
  2. removing pods and re-installing
  3. cleaning the build
  4. switching to legacy system.

Not sure which step solved it, but hopefully this helps others.

tranty9597 commented 5 years ago

I've met the same issue trying to integrate 0.60-rc.2 to a native swift app with use_frameworks! enabled.

I've integarated my app with RN but animation can not be stared in React native, could u help me?

jtreanor commented 5 years ago

@tranty9597 What React Native version are you using and can you share your Podfile? Sharing the error you are seeing may also be helpful.

tranty9597 commented 5 years ago

@tranty9597 What React Native version are you using and can you share your Podfile? Sharing the error you are seeing may also be helpful.

Thank for reply me!

RN version: 0.59.9

This is my pod file

Uncomment the next line to define a global platform for your project

platform :ios, '12.0'

source 'https://github.com/CocoaPods/Specs.git' target 'adamo-sample' do

Comment the next line if you don't want to use dynamic frameworks

use_frameworks! pod 'TwilioVideo', '~> 2.10' pod 'YogaKit' pod 'RxSwift', '~> 5' pod 'RxCocoa', '~> 5' pod 'FontAwesome.swift' pod 'SwiftMessages' pod 'Alamofire', '~> 4' pod "PromiseKit", "~> 6.8" pod 'SwiftyJSON', '~> 4.0'

Pods for adamo-sample

pod 'React', :path => '../node_modules/react-native', :subspecs => [ 'Core', 'CxxBridge', # Include this for RN >= 0.47 'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43 'RCTText', 'RCTImage', 'RCTNetwork', 'RCTWebSocket', # Needed for debugging 'RCTAnimation', # Needed for FlatList and animations running on native UI thread

Add any other subspecs you want to use in your project

] 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' target 'adamo-sampleTests' do inherit! :search_paths

Pods for testing

end

target 'adamo-sampleUITests' do inherit! :search_paths

Pods for testing

end

end

post_install do |installer| installer.pods_project.targets.each do |target| if target.name == "Yoga" target.remove_from_project end end end

Nothing error, it just do not start when I call Animated.sprint(opts).start()

jtreanor commented 5 years ago

RN version: 0.59.9

This issue is only concerned with the new CocoaPods integration in 0.60. Any problem you are having with 0.59.9 is unrelated.

tranty9597 commented 5 years ago

ed w

yep, I know it. I've been trying to intergarate RN to my swift app but animation not work. I didn't find any thing relate to my problem, so could you let me your contact and help me out

rj9676564 commented 5 years ago

RN version: 0.60.4 This is my pod file

use_frameworks!
targetsArray = ['AssociationAssistant']

targetsArray.each do |t|

#  RNRootDir="#{ENV['RNRootDir']}/node_modules"
  Pod::UI.puts "#{RNRootDir}"
  pod 'DoubleConversion', :podspec => "#{RNRootDir}/react-native/third-party-podspecs/DoubleConversion.podspec"
  pod 'glog', :podspec => "#{RNRootDir}/react-native/third-party-podspecs/glog.podspec"
  pod 'Folly', :podspec => "#{RNRootDir}/react-native/third-party-podspecs/Folly.podspec"

  pod 'React', :path => "#{RNRootDir}/react-native/"
  pod 'React-Core', :path => "#{RNRootDir}/react-native/React"
  pod 'React-DevSupport', :path => "#{RNRootDir}/react-native/React"
  pod 'React-fishhook', :path => "#{RNRootDir}/react-native/Libraries/fishhook"
  pod 'React-RCTActionSheet', :path => "#{RNRootDir}/react-native/Libraries/ActionSheetIOS"
  pod 'React-RCTAnimation', :path => "#{RNRootDir}/react-native/Libraries/NativeAnimation"
  pod 'React-RCTBlob', :path => "#{RNRootDir}/react-native/Libraries/Blob"
  pod 'React-RCTImage', :path => "#{RNRootDir}/react-native/Libraries/Image"
  pod 'React-RCTLinking', :path => "#{RNRootDir}/react-native/Libraries/LinkingIOS"
  pod 'React-RCTNetwork', :path => "#{RNRootDir}/react-native/Libraries/Network"
  pod 'React-RCTSettings', :path => "#{RNRootDir}/react-native/Libraries/Settings"
  pod 'React-RCTText', :path => "#{RNRootDir}/react-native/Libraries/Text"
  pod 'React-RCTVibration', :path => "#{RNRootDir}/react-native/Libraries/Vibration"
  pod 'React-RCTWebSocket', :path => "#{RNRootDir}/react-native/Libraries/WebSocket"

  pod 'React-cxxreact', :path => "#{RNRootDir}/react-native/ReactCommon/cxxreact"
  pod 'React-jsi', :path => "#{RNRootDir}/react-native/ReactCommon/jsi"
  pod 'React-jsiexecutor', :path => "#{RNRootDir}/react-native/ReactCommon/jsiexecutor"
  pod 'React-jsinspector', :path => "#{RNRootDir}/react-native/ReactCommon/jsinspector"
  pod 'yoga', :path => "#{RNRootDir}/react-native/ReactCommon/yoga"

  pod 'react-native-orientation',:path => "#{RNRootDir}/react-native-orientation"
  pod 'react-native-keep-awake', :path => "#{RNRootDir}/react-native-keep-awake"
  pod 'RNVectorIcons', :podspec => "#{RNRootDir}/react-native-vector-icons/RNVectorIcons.podspec"
  pod 'BVLinearGradient', :path => "#{RNRootDir}/react-native-linear-gradient"
  pod 'react-native-video', :path => "#{RNRootDir}/react-native-video"
  pod 'react-native-orientation', :path => "#{RNRootDir}/react-native-orientation"
  pod 'RNFastImage', :path => "#{RNRootDir}/react-native-fast-image"
  pod 'react-native-image-picker', :path => "#{RNRootDir}/react-native-image-picker"
  #    pod 'RNSyanImagePicker', :path => "#{RNRootDir}/react-native-syan-image-picker/ios"
  pod 'RNGestureHandler', :path => "#{RNRootDir}/react-native-gesture-handler"
  pod 'ReactNativePermissions', :path => "#{RNRootDir}/react-native-permissions"
  pod 'CodePush', :path => "#{RNRootDir}/react-native-code-push"
  pod 'RNReanimated', :path => "#{RNRootDir}/react-native-reanimated/RNReanimated.podspec"
  pod 'RNSVG', :path => "#{RNRootDir}/react-native-svg/"
  pod 'react-native-blur',:path => "#{RNRootDir}/react-native-blur/"
end

this is error info

/Users/dev_laibin/project/jft/Pods/Folly/folly/Conv.h:38:10: 'double-conversion/double-conversion.h' file not found
/Users/dev_laibin/project/JiForum/node_modules/react-native/ReactCommon/cxxreact/JSBigString.cpp:6:10: In file included from /Users/dev_laibin/project/JiForum/node_modules/react-native/ReactCommon/cxxreact/JSBigString.cpp:6:
/Users/dev_laibin/project/JiForum/node_modules/react-native/ReactCommon/cxxreact/JSBigString.h:12:10: In file included from /Users/dev_laibin/project/JiForum/node_modules/react-native/ReactCommon/cxxreact/JSBigString.h:12:
/Users/dev_laibin/project/jft/Pods/Folly/folly/Exception.h:25:10: In file included from /Users/dev_laibin/project/jft/Pods/Folly/folly/Exception.h:25:

Please help me.