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
react-native init AwesomeProject --version 0.60.0-rc.2
.use_frameworks!
to the top of ios/Podfile
cd ios && pod install
.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)
The app should build and run successfully.
I have created a sample repository to demonstrate the issue here: https://github.com/jtreanor/react-native-cocoapods-frameworks.
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.
I've met the same issue trying to integrate 0.60-rc.2
to a native swift app with use_frameworks!
enabled.
cc @orta @alloy @Salakar sorry to bother you folks, would you mind checking this issue?
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>
~~~~~~~^
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:
React-Core.podspec
into React-Core.podspec
, React-CxxBridge.podspec
and a third podspec with shared logic (since dependencies can't be circular).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.
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)
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.
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
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.
@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?
@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.
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.
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.
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
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.
@jtreanor Ah, we will check again. We encountered this issue a few days 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.
I m also facing the same issue. is any workaround for now
I m also facing the same issue. is any workaround for now
@_@ Can only cry dizzy in the toilet
I m also facing the same issue. is any workaround for now
@_@ Can only cry dizzy in the toilet
what does it mean ?
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.
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:
Is this case releated to this issue?
We faced a very similar issue when doing cocoapod repo lint when
React-cxxreact
was added as a dependency together withDoubleConversion
andFolly
. 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
[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 **
...
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:
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
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-name
with 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.
Same here with RN 0.60.4
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.
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:
Is this case releated to this issue?
Did you solve it? I'm having the same issue.
@cantonalex Can you share the Podfile
you are using in your project? That will help figure out what the issue you are having is.
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
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"
.
@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.
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.
It occurs whenever I use react-native link
Would love any solution. It's put me at a brick wall. Driving me nuts..
Opening a separate issue for the react-native link
issue could be a good idea. Perhaps you would get more useful responses there.
https://github.com/facebook/react-native/issues/25230 may be related.
What worked for me:
this fixed my issue, maybe it helps you.
@dcosmin2003 Your issue seems to be with a Cocoa-pod supported module though, mine aren't.
@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.)
@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...
@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?
@jtreanor It's not specific to 0.60 migration but has been happening to me repeatedly in the past.
In that case this seems like a separate issue. This issue is only dealing with the new CocoaPods integration in 0.60
I managed to successfully build after
Not sure which step solved it, but hopefully this helps others.
I've met the same issue trying to integrate
0.60-rc.2
to a native swift app withuse_frameworks!
enabled.
I've integarated my app with RN but animation can not be stared in React native, could u help me?
@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 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
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()
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.
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
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.
this one works for me:
then open xcode switching to legacy system, clean build and build again, it works for me :D
@MrLaibin You are using the RN version (0.60.4) which does not work with use_frameworks!
. I suggest removing use_frameworks!
from your Podfile or using the lastest RN from master
.
@jtreanor I use RN Verson 0.60.4 too, but i use unimodules which come from expo bare project. Should I delete use_unimodules too? I get error like:
CompileC ~/Documents/PROJECT/VoppSpace/mobile/voppmobile/ios/build/voppmobile/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-cxxreact.build/Objects-normal/x86_64/RAMBundleRegistry.o ~/Documents/PROJECT/VoppSpace/mobile/voppmobile/node_modules/react-native/ReactCommon/cxxreact/RAMBundleRegistry.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
my podfile:
platform :ios, '10.0'
require_relative '../node_modules/react-native-unimodules/cocoapods'
target 'voppmobile' do
# Pods for voppmobile
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'
use_unimodules!
target 'voppmobileTests' do
inherit! :search_paths
end
end
Didn't this get fixed in master? Can we roll a new release?
this one works for me:
- close xcode and any other IDE
rm -rf ~/library/developer/xcode/deriveddata
rm -rf ~/.rncache
rm -rf node_modules && npm install && cd ios && rm -rf Pods && pod install && cd ..then open xcode switching to legacy system, clean build and build again, it works for me :D
This is work for me too. But if you upgrade to RN 0.60.4 and use react-navigation you will get error if you not linking manually, Follow this open issues: https://github.com/kmagiera/react-native-gesture-handler/issues/494
i use unimodules which come from expo bare project. Should I delete use_unimodules too?
I'm not familiar with unimodules. I suggest asking on the unimodules repo.
Didn't this get fixed in master? Can we roll a new release?
Yes, it's fixed in master so you can use the fixed version directly from the repo if you wish. The React Native maintainers have been very helpful with these changes and I'm sure they will include it in an upcoming release.
Is it known - has this fix finally been released (or at least scheduled) as of version 0.60.5
? I'd really like to leverage the benefits of frameworks in my app...
@genuinezack Nope, the fix isnβt in 0.60.5 due to the breaking changes involved. I would expect to see it in 0.61.0
Didn't use use_frameworks!
but had the same error. For me adding :modular_headers => true
to DoubleConversion
pod solved the problem.
@jtreanor where to add the 'DEFINES_MODULE' => 'NO' ?
I managed to successfully build after
- deleting derived data
- removing pods and re-installing
- cleaning the build
- switching to legacy system.
Not sure which step solved it, but hopefully this helps others.
Works for me! Especially the switching to a legacy system.
Changing this line in Conv.h just fixed it for me:
#include <double-conversion/double-conversion.h>
to
#include <double-conversion.h>
RN: 0.60.5
Xcode: 10.1
@gdavidetanca Haha, that works. I mean, obviously not what you should be doing, but... It works.
That works for me too! although I shouldn't be doing that. Is there a proper way to fix this?
The changes I made to fix this are included in 0.61.0-rc.3 so that version should now be working with use_frameworks!
I can confirm. I'm on 0.61-rc3 and it works.
I am facing 'React/RCTBundleURLProvider.h' file not found in AppDelegate file. I am not using frameworks. Using libraries libpods.app.a file to link.
Here my question is all my packages in the podfile is removed automatically after run pod install
(Pod installation complete! There are 20 dependencies from the Podfile and 26 total pods installed.)([!] use_native_modules! skipped the react-native dependency 'react-native-cookie'. No podspec file was found.)
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
pod 'Fabric'
pod 'Crashlytics'
target 'App' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
#use_frameworks!
# Pods for App
target 'App-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'AppTests' do
inherit! :search_paths
# Pods for testing
use_native_modules!
end
end
@nihp use_native_modules!
should be in the 'App'
target. Right now you have it in the 'AppTests'
target, which is why the packages are removed from the App. You should also have React
podspecs dependencies defined in your Podfile.
There are multiple things off in your Podfile. It seems you converted from a <=0.59 project? Libraries
in Xcode are not used anymore. I recommend you generate a new project using the latest version of React Native and copy the generated Podfile into your project.
Redefinition of Module React , previously defined here in Dev Support module, Any idea. I have upgraded react-native version from 0.59.8 to 0.60.6. Any idea anyone?
Most helpful comment
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.