question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:65
  • Comments:70 (26 by maintainers)

github_iconTop GitHub Comments

27reactions
kelsetcommented, 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.

24reactions
khalidos32commented, Aug 6, 2019

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 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trouble with installing cocoapods | Apple Developer Forums
I tried several ways to fix it, but nothing works. Code Block sudo gem install cocoapods. Building native extensions. This could take a...
Read more >
failed to build ios project. we ran xcodebuild command but it ...
Create a new project: react-native init AwesomeProject --version 0.60.0-rc.2 . Add use_frameworks! to the top of ios/Podfile; Install pods: cd ios && ...
Read more >
update react native from 0.59 to 0.64.2 ---- - No such file or ...
I fixed the error. If someone has the problem, you should do the next. In the 0.59 version uses the next pod 'Folly',...
Read more >
React Native SDK Troubleshooting - Visual Studio App Center
React Native lower than 0.60 ... One possible cause is when running react-native link without CocoaPods installed. ... If you see that error,...
Read more >
React Native - Manual iOS Setup - Flipper
These details within this page are for people manually adding Flipper to a React Native 0.62+ app. This should only be necessary if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found