react-native: Xcode 10: Build input file double-conversion cannot be found
Environment
>> react-native info
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
Memory: 554.38 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
Yarn: 1.9.4 - /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.0, macOS 10.14, tvOS 12.0, watchOS 5.0
IDEs:
Android Studio: 3.1 AI-173.4907809
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
react: 16.5.0 => 16.5.0
react-native: 0.57.0 => 0.57.0
Description
The cli is broken once you have installed xcode 10. Creating any new project will render the same issue (compilation failure) as it seems to be failing compiling double conversion as illustrated below:
react-native run-ios
Found Xcode project awesome.xcodeproj
Launching iPhone 6 (iOS 12.0)...
Building using "xcodebuild -project awesome.xcodeproj -configuration Debug -scheme awesome -destination id=F0EA48DA-E7A0-4E8F-92B3-3D4A2AA93B76 -derivedDataPath build"
▸ Copying /Users/rod/dev/react/testing/awesome/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.h
▸ Copying /Users/rod/dev/react/testing/awesome/node_modules/react-native/ReactCommon/yoga/yoga/YGEnums.h
▸ Copying /Users/rod/dev/react/testing/awesome/node_modules/react-native/ReactCommon/yoga/yoga/YGMacros.h
▸ Compiling YGStyle.cpp
▸ Compiling YGLayout.cpp
▸ Compiling Yoga.cpp
▸ Compiling YGNode.cpp
▸ Compiling YGNodePrint.cpp
▸ Compiling YGFloatOptional.cpp
▸ Compiling YGEnums.cpp
▸ Compiling Utils.cpp
▸ Analyzing Yoga.cpp
▸ Analyzing YGStyle.cpp
▸ Analyzing YGNodePrint.cpp
▸ Analyzing YGNode.cpp
▸ Analyzing YGLayout.cpp
▸ Analyzing YGFloatOptional.cpp
▸ Analyzing YGEnums.cpp
▸ Analyzing Utils.cpp
▸ Building library libyoga.a
▸ Copying /Users/rod/dev/react/testing/awesome/node_modules/react-native/ReactCommon/jsinspector/InspectorInterfaces.h
▸ Compiling InspectorInterfaces.cpp
▸ Analyzing InspectorInterfaces.cpp
▸ Building library libjsinspector.a
▸ Copying /Users/rod/dev/react/testing/awesome/node_modules/react-native/ReactCommon/privatedata/PrivateDataBase.h
▸ Compiling PrivateDataBase.cpp
▸ Analyzing PrivateDataBase.cpp
▸ Building library libprivatedata.a
▸ Running script 'Install Third Party'
▸ Compiling strtod.cc
❌ error: Build input file cannot be found: '/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/strtod.cc'
▸ Compiling fast-dtoa.cc
❌ error: Build input file cannot be found: '/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/fast-dtoa.cc'
▸ Compiling fixed-dtoa.cc
❌ error: Build input file cannot be found: '/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/fixed-dtoa.cc'
▸ Compiling double-conversion.cc
❌ error: Build input file cannot be found: '/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/double-conversion.cc'
▸ Compiling diy-fp.cc
❌ error: Build input file cannot be found: '/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/diy-fp.cc'
▸ Compiling cached-powers.cc
❌ error: Build input file cannot be found: '/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/cached-powers.cc'
▸ Compiling bignum.cc
❌ error: Build input file cannot be found: '/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/bignum.cc'
** BUILD FAILED **
The following build commands failed:
CompileC /Users/rod/dev/react/testing/awesome/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/strtod.o /Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/strtod.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/rod/dev/react/testing/awesome/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/fast-dtoa.o /Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/fast-dtoa.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/rod/dev/react/testing/awesome/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/fixed-dtoa.o /Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/fixed-dtoa.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/rod/dev/react/testing/awesome/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/double-conversion.o /Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/double-conversion.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/rod/dev/react/testing/awesome/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/diy-fp.o /Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/diy-fp.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/rod/dev/react/testing/awesome/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/cached-powers.o /Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/cached-powers.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/rod/dev/react/testing/awesome/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/bignum.o /Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/bignum.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(7 failures)
Installing build/Build/Products/Debug-iphonesimulator/awesome.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/awesome.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/awesome.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:602:13)
at Object.execFileSync (child_process.js:622:13)
at Promise.then (/Users/rod/dev/react/testing/awesome/node_modules/react-native/local-cli/runIOS/runIOS.js:208:5)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
Reproducible Demo
- Let you mac update to xcode 10 and command line tools.
- Create brand new project
react-native init awesomeApp
- Once it has finished setting up, run
cd awesomeApp && react-native run-ios
Workaround for new projects
Once the project has been initialised, kill facebook’s team identifiers with
sed -i '' '/DevelopmentTeam = V9WTTPBFK9/d;/DEVELOPMENT_TEAM/d;/ProvisioningStyle = Automatic/d' ./node_modules/react-native/React/React.xcodeproj/project.pbxproj
Running react-native run-ios
this time should work.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 51
- Comments: 44 (15 by maintainers)
I was facing a similar issue after upgrading. To solve it I ran the following commands:
Now Xcode builds fine.
@mattijsf 's suggestion worked for me, it can be found in the xcode ui via:
Temporary workaround of course 👀
@ChrisChares I discovered that running the bare
configure
script actually produces a faultyconfig.h
, causing issues building on physical devices in Xcode 10. Please consider one of the following approaches:cd node_modules/react-native/third-party/glog-0.3.5/ && ../../scripts/ios-configure-glog.sh
I also met this problem after upgrading my Xcode to version 10. Combining all the possible workarounds above, I fix this by:
Clean RN cache
Re-install the deps
Then install the third-party
Run the commands below if glog installation failed.
It works for me, I hope it helps for you.
I actually found that Xcode 10 has a new build system that affects how / when scripts are executed during the Build Phase. I had similar problems in Xcode 10 with other internal projects which generate files during the build phase.
For those projects and react-native I found that switching to the Legacy Build Systems solved the problem where the dependencies (third-party / glog etc) are not correctly generated on the first build.
To switch to the legacy build system do the following:
Note that the project changes won’t be picked up by git because
project.xcworkspace
is part of the.gitignore
file generated byreact-native init
I was having a similar issue, in my case, just accepting the xcode license solved all issues.
Did the job in my case.
React-Native 0.55.4 macOS Mojave, xcode 10
rm .rncatch && clear project && run project
If running an error:glog-0.3.x
pleasecd ./node_modules/react-native/third-party/glog-0.3.x && ./../scripts/ios-configure-glog.sh
@kelset It is a project / workspace setting. Once the settings is changed within Xcode a file is written to:
ios/[Project].xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
:(the path will be different for workspaces)
I also tried applying that setting to only
node_modules/react-native/React/React.xcodeproj
but that won’t work. It really needs to be on the “parent” project / workspace that initiates the build.I’m seeing the same too. @mattijsf’s solution did allow iOS to compile, however as a side effect, I then saw the following errors when trying to run the Android version:
Clearing down node_modules and re-running
npm install
allowed Android to compile, but failed on iOS again.@kelset In response to your question above - this happened both on an old project created before XCode 10 was installed and a new project created after XCode 10 was installed. It happens on both RN 0.56 and 0.57.
I used this:
and this: link libfishhook.a
and I am working fine
It feels to me this issue is impacted by some parallel build / racing condition…
I can repeat the following script 10x but I get the same error every time:
rm -rf TestAppRN0570 ; react-native init TestAppRN0570 ; cd TestAppRN0570 ; react-native run-ios ; cd ..
However if execute
react-native run-ios
again for the 2nd time it builds. So basically only the initialrun-ios
fails.The same thing can be said with opening the project for the first time in Xcode (without using
run-ios
) The first build fails, the second build succeeds.@mattijsf Yeah, I’ve tested on a physical device running iOS12.
I’m on 54.4 and this works
ios-install-third-party.sh
should be exec in thenode_modules/react-native
directoryMy solution, add the code to my
scripts/postinstall.sh
fileHi, just providing some feedback based on my experience:
Cheers!
The original issue text’s workaround for new projects looks like what we already have in place in master (https://github.com/facebook/react-native/commit/8103c431c897c02d47cfad1e71bb2e6ddaabbdc0).
Can people make the change from https://github.com/facebook/react-native/commit/8103c431c897c02d47cfad1e71bb2e6ddaabbdc0 to their project and verify if that, by itself, solves the issue?
@chrisbianca This happened to me on existing project, try to remove your node modules, clear watchman cache and yarn / npm cache to re-install everything (maybe even try clearing lock files if you can). After I did all that, third party issue wen’t away.
This issue has more info: https://github.com/facebook/react-native/issues/14382