-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Description
- Review the documentation: https://facebook.github.io/react-nativeSearch for existing issues: https://github.com/facebook/react-native/issuesUse the latest React Native release: https://github.com/facebook/react-native/releasesTo pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Environment
Scanning folders for symlinks in .../node_modules (21ms)
React Native Environment Info:
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-6567U CPU @ 3.30GHz
Memory: 1.00 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.3.0 - /usr/local/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 6.1.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
IDEs:
Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
npmPackages:
react: 16.3.2 => 16.3.2
react-native: 0.56.0-rc.2 => 0.56.0-rc.2
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
Description
Trying to build the initial React Native project is not working on Xcode 10 on Mojave, tested on two machines and had slightly different issues both while compiling glog.
react-native init TestProject --version="0.56.0-rc.2"
cd TestProject
npm run start
react-native run-ios
Fails because 'config.h' file not found
on mutex.h
. Manually configuring and making glog from node_modules/react-native/third-party/glog-0.3.4
works, but then fails because 'gflags/gflags.h' file not found
.
If I try to compile on Xcode 9.4, it also fails. The only thing that enabled me to build on either was:
rm -rf ~/.rncache/
rm -rf $PROJECT/node_modules/react-native/third-party/
- Build on Xcode 9.4, passes. Quit Xcode.
- Build on Xcode 10, passes.
It is very unstable though, stops working as soon as I reopen Xcode.
I've tested on another machine and had another issue with glog build:
checking for arm-apple-darwin-gcc... /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch undefined_arch -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk
checking whether the C compiler works... no
configure: error: in `(..._/node_modules/react-native/third-party/glog-0.3.4':
configure: error: C compiler cannot create executables
See `config.log' for more details
config.log: https://pastebin.com/8M4ybuEp
This machine did not have Xcode installed before. I did install the Command Line Utils.
Reproducible Demo
On macOS Mojave with Xcode 10.
react-native init TestProject --version="0.56.0-rc.2"
cd TestProject
npm run start
react-native run-ios
Fails because 'config.h' file not found
on mutex.h
.
Activity
futuun commentedon Jun 17, 2018
I had the same issue but manually triggering configure script
(cd ./node_modules/react-native/third-party/glog-0.3.4 && ../../scripts/ios-configure-glog.sh)
resolves it.Also - If you want to build app for iOS 12 you have to switch path to the active developer directory (
xcode-select -s /Applications/Xcode-beta.app/Contents/Developer
).eliperkins commentedon Jun 18, 2018
I can also confirm this issue appearing when upgrading from RN 0.54 -> 0.56, building using Xcode 10 (or the Xcode 9 Preview Build System).
Like @futuun mentioned, this is resolved by manually triggering the configure script.
It sounds like the new build system isn't running that step by the time it's build artifacts are needed. Where is the
ios-configure-glog.sh
executed in the RN build process?futuun commentedon Jun 18, 2018
In
double-conversion
anddouble-conversion-tvOS
as part ofInstall Third Party
phase.eliperkins commentedon Jun 18, 2018
Ah, it looks like that script phase should be configured to have theconfig.h
as an output file, so that the new build system knows it needs to run the phase: https://asciiwwdc.com/2018/sessions/408#t=893.696EDIT: Turns out this isn't true.
eliperkins commentedon Jun 18, 2018
I dug into this a bit further today, and it seems as though the
ios-configure-glog.sh
is never being called as part ofios-install-third-party.sh
when using the new build system.Using
set -x
inside ofios-install-third-party.sh
, I end up with this:There is no call to
exec ios-configure-glog.sh
here.kelset commentedon Jun 21, 2018
Related to supporting XCode 10, it seems like a PR has been already merged on master: #19781
If you could verify if it fix it, we can cherry pick it for 0.56 before moving out of RC
futuun commentedon Jun 21, 2018
No, the PR you linked fixes other issue. You can have few versions of Xcode and switch between them, that PR is for making sure that you are using simulator from active version.
This issue is connected to new build system (@eliperkins linked WWDC transcript). Not sure if we can have changes that will work with Xcode 10 and will be backward compatible with Xcode 9.
kelset commentedon Jun 21, 2018
Hey @futuun thanks for the detailed clarification :)
Since XCode 10 is still in Beta 1 I feel like then probably 0.56 won't support it, and if the support for it is a breaking change then it will need to be discussed further (this issue I think is a good starting point for this).
eliperkins commentedon Jun 21, 2018
I'd say the 99% of the issues with the new build system will be backwards compatible.
As far as this issue goes, I've spent a few more minutes look at it, and I'm positive that this is failing on the new build system due to
ios-install-third-party.sh
never successfully callingios-configure-glog.sh
.Additionally, this seems extremely related to this commit: 5c53f89#diff-db5be184065c4ffa44ee6585f41e6a69 @janicduplessis @javache
Can someone with more bash script expertise than myself take a look at
ios-install-third-party.sh
to see what could be causing this? @mhorowitz @fkgozalifkgozali commentedon Jun 21, 2018
cc @hramos, @axe-fb
16 remaining items