Closed
Description
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
- Create a new project:
react-native init AwesomeProject --version 0.60.0-rc.2
. - Add
use_frameworks!
to the top ofios/Podfile
- Install pods:
cd ios && pod install
. - 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.