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

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

Open
jtreanor opened this issue Jun 21, 2019 · 38 comments

Comments

Projects
None yet
@jtreanor
Copy link
Contributor

commented Jun 21, 2019

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

This comment has been minimized.

Copy link
Collaborator

commented Jun 23, 2019

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

@kelset

This comment has been minimized.

Copy link
Collaborator

commented Jun 24, 2019

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

@jtreanor

This comment has been minimized.

Copy link
Contributor Author

commented Jun 24, 2019

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 97e6ea1).

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

This comment has been minimized.

Copy link
Contributor Author

commented Jun 24, 2019

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 97edac1.

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

  • Split React-Core.podspec into React-Core.podspec, React-CxxBridge.podspec and a third podspec with shared logic (since dependencies can't be circular).
  • Find a way to build the library podspecs as C++ so that it doesn't trip up. I'm not sure if it is possible and it may just hide the problem for a later time.

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

This comment has been minimized.

Copy link
Collaborator

commented Jun 25, 2019

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 added a commit to jtreanor/react-native-cocoapods-frameworks that referenced this issue Jun 25, 2019

@jtreanor

This comment has been minimized.

Copy link
Contributor Author

commented Jun 25, 2019

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: #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

This comment has been minimized.

Copy link

commented Jun 25, 2019

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 added a commit to jtreanor/react-native-cocoapods-frameworks that referenced this issue Jun 25, 2019

jtreanor added a commit to jtreanor/react-native-cocoapods-frameworks that referenced this issue Jun 25, 2019

@jtreanor

This comment has been minimized.

Copy link
Contributor Author

commented Jun 25, 2019

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

This comment has been minimized.

Copy link

commented Jun 25, 2019

@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

This comment has been minimized.

Copy link
Contributor Author

commented Jun 25, 2019

@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.

@marecar3 marecar3 referenced this issue Jun 25, 2019

Merged

Experiment - Gutenberg Android X migration #10020

1 of 1 task complete

@hramos hramos self-assigned this Jun 25, 2019

@fkgozali

This comment has been minimized.

Copy link
Contributor

commented Jun 29, 2019

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

This comment has been minimized.

Copy link
Contributor Author

commented Jul 1, 2019

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.

@kelset kelset referenced this issue Jul 1, 2019

Merged

0.60 and tooling #120

facebook-github-bot added a commit that referenced this issue Jul 10, 2019

CocoaPods frameworks compatibility: Step 1 (#25496)
Summary:
This is the first step towards fixing #25349. These are the changes to the podspec to correctly update dependencies and build config that will cause any breaking change for users or libraries.

I am breaking these changes out from #25393 as suggested by fkgozali in #25393 (comment).

These are the changes:

- Made C++ headers in `React-Core` private by default so that ObjC files can import the module without failures.
- Reduced the number of `yoga` headers that are exposed for the same reason as above. As far as I can see this doesn't cause issues but we can find another solution if it does.
- Adding some missing dependencies to fix undefined symbols errors.
- Added `DoubleConversion` to `HEADER_SEARCH_PATHS` where it was missing.

## Changelog

[iOS] [Fixed] - Updated podspecs for improved compatibility with different install types.
Pull Request resolved: #25496

Test Plan:
Everything should work exactly as before. I have a branch on my [sample project](https://github.com/jtreanor/react-native-cocoapods-frameworks) here which points at this branch to show that it is still working `Podfile` to demonstrate this is fixed.

You can see that it works with these steps:

1. `git clone git@github.com:jtreanor/react-native-cocoapods-frameworks.git`
2. `git checkout podspec-updates`
3. `cd ios && pod install`
4. `cd .. && react-native run-ios`

The sample app will build and run successfully.

Reviewed By: mmmulani

Differential Revision: D16167346

Pulled By: fkgozali

fbshipit-source-id: 1917b2f8779cb172362a457fb3fce686c55056d3
@MaRuifeng

This comment has been minimized.

Copy link

commented Jul 12, 2019

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

This comment has been minimized.

Copy link
Contributor Author

commented Jul 12, 2019

Oh, interesting @MaRuifeng.

Unless I'm mistaken that error should have been fixed in #25496, which is now in master.

@MaRuifeng

This comment has been minimized.

Copy link

commented Jul 12, 2019

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

@gdsx521

This comment has been minimized.

Copy link

commented Jul 13, 2019

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.

@iOSUser110

This comment was marked as off-topic.

Copy link

commented Jul 15, 2019

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

@gdsx521

This comment was marked as spam.

Copy link

commented Jul 15, 2019

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

@iOSUser110

This comment was marked as spam.

Copy link

commented Jul 15, 2019

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

what does it mean ?

@kelset

This comment has been minimized.

Copy link
Collaborator

commented Jul 15, 2019

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

This comment has been minimized.

Copy link

commented Jul 16, 2019

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?

@dcvz dcvz referenced this issue Jul 16, 2019

Open

v2 [@next, rc-13 published] #662

3 of 7 tasks complete
@rajeshde

This comment has been minimized.

Copy link

commented Jul 16, 2019

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

This comment has been minimized.

Copy link

commented Jul 16, 2019

[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

This comment has been minimized.

Copy link

commented Jul 18, 2019

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:

  • macOS Mojave 10.14.5
  • XCode Version 10.2.1 (10E1001)

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

This comment has been minimized.

Copy link

commented Jul 18, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Jul 20, 2019

Same here with RN 0.60.4

@mboettcher

This comment has been minimized.

Copy link

commented Jul 22, 2019

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

This comment has been minimized.

Copy link

commented Jul 22, 2019

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

This comment has been minimized.

Copy link
Contributor Author

commented Jul 22, 2019

@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

This comment has been minimized.

Copy link

commented Jul 22, 2019

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

This comment has been minimized.

Copy link
Contributor Author

commented Jul 22, 2019

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

This comment has been minimized.

Copy link

commented Jul 22, 2019

@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

This comment has been minimized.

Copy link
Contributor Author

commented Jul 22, 2019

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

This comment has been minimized.

Copy link

commented Jul 22, 2019

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

@jtreanor

This comment has been minimized.

Copy link
Contributor Author

commented Jul 22, 2019

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

@cantonalex

This comment has been minimized.

Copy link

commented Jul 22, 2019

#25230 may be related.

@dcosmin2003

This comment has been minimized.

Copy link

commented Jul 22, 2019

What worked for me:

  • deleted [ios/Pods]
  • deleted [node_modules]
  • run again $npm install && pod install

this fixed my issue, maybe it helps you.

@cantonalex

This comment has been minimized.

Copy link

commented Jul 23, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.