Closed joncursi closed 6 years ago
anyway, now this issue here should be fixed with 0.46.4
I think we've got to work on a less entitled attitude. It's easy to forget that we're using React-Native, and the work of others, for free.
Sure, it's frustrating to have build issues, but come up with a procedure to test the build before you use it? You don't need to follow bleeding edge.
@doyouno your solution is right, now its working
I got the same issue on 0.46.4 version and on 0.47.0-rc.4. What I'm doing wrong?
@damirjs just follow @doyouno 's solution
you can just install glog yourself to solve this program. cd /glog then ./configure make make install
build in Xcode again, problem never comes back .
@ddpatel2606 Thank you for answer!
make install
threw this error:
make: /Volumes/Macintosh: No such file or directory
make: *** [install-am] Error 1
and packager:
Error watching file for changes: EMFILE
{"code":"EMFILE","errno":"EMFILE","syscall":"Error watching file for changes:","filename":null}
Error: Error watching file for changes: EMFILE
at exports._errnoException (util.js:1018:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1420:11)
but app build successfully.
UPD: For resolving problems with watcher i used this recommendations: https://github.com/facebook/react-native/issues/10088#issuecomment-265242851 and https://github.com/facebook/react-native/issues/10088#issuecomment-310328595 Its works!!!
@Ignigena thanks! It works for me.
rm ~/.rncache/*
and build again.
It work for me.
@Ignigena very good
react-native/scripts/ios-install-third-party.sh
SCRIPTDIR=$(cd "$(dirname "$0")"; pwd)
# SCRIPTDIR="../../scripts"
It works.
I followed instructions from @javache and able to resolve the problem...(v 0.47)
If anybody facing the same issue as I have mentioned, can pull working template project from
https://github.com/chiragpurohit71085/working_react_native_0.47
@s13524801 i test every solution. only your's can work. thank you very mush. my react-native version is react-native@0.46.4 . so . maybe in the ios-install-third-party.sh need add cd $(dirname $0) ?
for anyone finding this on RN v0.47.2, I needed to follow this very specific order of steps to get it working:
rm -rf node_modules && npm install
node_modules/react-native/third-party/glog
and run ../../scripts/ios-configure-glog.sh
rm -rf ~/.rncache
For whatever reason, other combinations of the other solutions wouldn't work. Like running ios-install-third-party.sh
separately (with the $SOURCEDIR
fix) before ../../scripts/ios-configure-glog.sh
would still get the error.
This also worked for RN 0.47 by @SudoPlz https://github.com/facebook/react-native/issues/14382#issuecomment-309865151
cd node_modules/react-native/third-party/glog-*
../../scripts/ios-configure-glog.sh
boost_1_63_0.tar.gz double-conversion-1.1.5.tar.gz folly-2016.09.26.00.tar.gz and glog-0.3.4.tar.gz
.Make sure all of this file is ok.If any problem, you can download and replace by youself.My problem is, when downloading boost_1_63_0.tar.gz , it failed.
was having the same issue, tried ios-configure-glog.sh and it fixed that issue but raised this....
In my case after running ../../scripts/ios-configure-glog.sh
I always got an error like this:
configure: error: in 'PATH_TO_RN_PROJECT/node_modules/react-native/third-party/glog-0.3.4':
configure: error: C compiler cannot create executables
In config.log I found the following line:
checking for arm-apple-darwin-gcc... /Users/MYUSER/Downloads/Xcode 9.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Users/MYUSER/Downloads/Xcode 9.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk
After moving my xcode to programs and rename it from 'Xcode 9' to 'Xcode' the error was gone.
I'm posting this because maybe someone has a similar situation 🍺
Renaming Xcode 9.app
to Xcode9.app
(without space) and following steps https://github.com/facebook/react-native/issues/14382#issuecomment-327412326 and https://github.com/facebook/react-native/issues/14382#issuecomment-326919739 fixed the problem for me.
I tried all the stuffs above, to no avail.
Then,
I updated npm and all that shit worked!
Be sure these four files glog-0.3.4.tar.gz double-conversion-1.1.5.tar.gz boost_1_63_0.tar.gz folly-2016.09.26.00.tar.gz in ~/.rncode are integrity.
Be sure these four files glog-0.3.4.tar.gz double-conversion-1.1.5.tar.gz boost_1_63_0.tar.gz folly-2016.09.26.00.tar.gz in ~/.rncode are integrity.
@masterkrang Thanks for the support. It's working for me ;)
Yup, after rm -rf node_modules && npm i
it worked. Thanks guys.
Wow, very interesting.
rm -rf node_modules && npm i
it's worked!
this problem seams to be fixed in react native version 4.7 and higher.
I have the same error with react-native@0.50.3 today and rm -rf node_module && npm i
did the trick.
Still getting the issue with react-native 0.50.3. Also tried the fix of running cd node_modules/react-native/third-party/glog-* ../../scripts/ios-configure-glog.sh
But that fails too
/Users/e/myproject/node_modules/react-native/third-party/glog-0.3.4/missing: Unknown `--is-lightweight' option
Try `/Users/e/myproject/node_modules/react-native/third-party/glog-0.3.4/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for arm-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-apple-darwin-gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk
checking whether the C compiler works... no
configure: error: in `/Users/e/myproject/node_modules/react-native/third-party/glog-0.3.4':
configure: error: C compiler cannot create executables
See `config.log' for more details
I was still having this problem using the latest release, react-native 0.50.3
.
After running all the build scripts manually one by one (and almost giving up in the process, btw), I found that moving into glog folder (node_modules/react-native/third-party/glog-0.3.4/
) and running the build process actually fixed it. The commands used where the following:
./configure
make
make install
After all of this, voila, it was working!
Nevertheless, after running the last command, I saw a message indicating that it could not find /Applications/Xcode.app
, which seemed really weird.
I realized that since I was using different versions of Xcode at the same time (8.3.2 and 9.0) I renamed both applications to indicate their version (Xcode 8.3.2 and Xcode 9, respectively). Just renaming the latest one to Xcode
again, and running rm -rf ~/.rncache
fixed it!
Seems to me that this could be easy fixable, since it looks like the path is harcoded. Just check that that Xcode was renamed correctly. Weirdly, I had to restart my computer in order for macOS to apply the name change
Just hit this after updating from React Native v0.47 to v0.50
I hit Product > Clean, closed Xcode, combined the instructions above:
rm -rf ~/.rncache
rm -rf node_modules
npm install
Then reopened Xcode, and the build worked normally! 👍
Part of @fedeojeda95's solution worked for me! :)
Note that previous to achieve it I've upgraded react-native
to version 0.50.3
:
react-native-git-upgrade
and I also did run:
rm -rf ~/.rncache
and:
npm install
I don´t know if any of those previous steps have had any impact on next steps working on. So I've gone through the following steps with success:
Close Xcode.
Open Terminal
, go to your project's root folder and do:
cd node_modules/react-native/third-party/glog-0.3.4/
Run the configure script:
./configure
Open Xcode and try to run your app.
If on project navigator you can see the "Libraries/React.xcodeproj/ThirdParty/glog/config.h
" file(not in red), that's a good indication that your app should now compile and run ok.
If anyone is still having this issue, I upgraded to the latest version of Xcode 9.2 (stable) and the error went away and my project built without any issues.
cd /glog then
./configure
make
make install
make install
still error but it's build succeeded.
Version on my machine:
react-native-cli: 2.0.1
react-native: 0.51.0
I had "Unrecognized font family MaterialIcons".
While building ios app I had Build Failed because of it was looking for fonts in ..../node_modules/native-base/....
And I checked and found out that I have no 'react-base' installed.
So react-native install native-base
and then rebuild ios app helped me.
Well, for me, nothing of this worked, the third-party
folder doesn't even exist anymore in 0.48.3
I manually added the config.h file to the Pods project and pointed it to the GLog target as public for fixing the issue, seems like the prepare_command
(in the podspec) is never executed when using the :path option in the Podfile so ios-configure-glog.sh
is never executed, also configure
is missing (which is needed in the script)
RN v. 0.50.4. Had the same issue. Did 2 and 3 from @RicardoBarroso comment and also cleared the project -> worked.
*The only thing was that after this I had to completely delete an app from a device, cuz a default iOS launch screen (xib) started to appea and I was unable to remove it (there was no xib in the xcodeproj).
I just ran in this on 0.51. I went to the third-party folder and deleted it. After that started the build process in iOS and it recreated the folder and all went good.
I just ran in this on 0.51 as well.
rm -rf node_modules
yarn install
solved the issue
I get a very strange issue
../../scripts/ios-configure-glog.sh
./configure: line 1722: syntax error: unexpected end of file
The file looks like this 😳
Running ../../scripts/ios-configure-glog.sh
I am getting the following error (after upgrading to the current RN 0.52.2
version yesterday):
config.status: creating src/config.h
awk: illegal statement
input record number 1, file src/config.h.in
source line number 56
config.status: error: could not create src/config.h
Already tried removing rm -rf node_modules
and rm -rf ~/.rncache
.
Still no joy, I have to go back as far as rn 0.39.0
to be able to build.
When I run ../../scripts/ios-configure-glog.sh
on a rn 0.53.0
version I get the following error (I get the same error when I manually run ./configure
in the node_modules/react-native/third-party/glog-0.3.4
directory):
...
checking how to access the program counter from a struct ucontext... configure: WARNING: Could not find the PC. Will not output failed addresses...
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/glog/logging.h
config.status: creating src/glog/raw_logging.h
config.status: creating src/glog/vlog_is_on.h
config.status: creating src/glog/stl_logging.h
config.status: creating libglog.pc
config.status: creating src/config.h
awk: illegal statement
input record number 1, file src/config.h.in
source line number 55
config.status: error: could not create src/config.h
These are only the last few lines, am happy to post the whole output if that helps. This is on a brand new test project which I initialised for this test.
this should solve:
rm -rf ~/.rncache
rm -rf node_modules
yarn
react-native run-ios
we can close this, it is not happening in latest react-native versions
@sibelius That procedure did not fix it on my machine. Still happening with rn 0.53 for me on a brand new project, initialised just for testing this.
Even went so far as deinstalling Xcode and nvm and upgraded to node 9.4.0.
As said I had to fall back to rn 0.39 in order to successfully build.
I just installed react-native to this MacOS X system, following the instructions to the letter, and I'm getting the "config.h file not found" error in mutex.h when trying to build with Xcode. Also, "react-native run-ios" does not work (giving an xcrun error about missing "instruments").
This issue was reported on June 2017. We are now on February 2018, and the problem still persists. I find this absolutely mind-boggling. Exactly how long can it take for a problem like this to be fixed?
Btw, removing the node_modules directory from the project and running "npm install" fixed the problem somehow.
I had to upgrade react-native
version to 0.50.0
as dependency to another package. But after that I am getting config.h
error.
My current working package.json
{
"name": "MyApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.45.1",
"react-native-elements": "^0.19.0",
"react-navigation": "^1.0.0-beta.29"
},
"devDependencies": {
"babel-jest": "22.1.0",
"babel-preset-react-native": "4.0.0",
"jest": "22.1.4",
"react-test-renderer": "16.0.0-alpha.12"
},
"jest": {
"preset": "react-native"
}
}
I tried above solutions like,
npm install
So, I decided to create a new project, but it failed with same error config.h error.
New project's package.json
{
"name": "TestProject",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.2.0",
"react-native": "0.53.0"
},
"devDependencies": {
"babel-jest": "22.2.2",
"babel-preset-react-native": "4.0.0",
"jest": "22.3.0",
"react-test-renderer": "16.2.0"
},
"jest": {
"preset": "react-native"
}
}
SOLUTION: I had 2 xcode versions. I removed the old one and it worked.
Hi everyone .... i have bug 'config.h' file not found but i run ../../scripts/ios-configure-glog.sh
. it didn't work and in teminal show
Vuongs-MacBook-Pro:glog-0.3.4 vuonghaithanh$ ../../scripts/ios-configure-glog.sh ../../scripts/ios-configure-glog.sh: line 7: xcrun: command not found ../../scripts/ios-configure-glog.sh: line 7: xcrun: command not found checking for a BSD-compatible install... /usr/local/bin/ginstall -c checking whether build environment is sane... yes /Users/vuonghaithanh/WebstormProjects/testreact/node_modules/react-native/third-party/glog-0.3.4/missing: Unknown
--is-lightweight' option
Try /Users/vuonghaithanh/WebstormProjects/testreact/node_modules/react-native/third-party/glog-0.3.4/missing --help' for more information configure: WARNING: 'missing' script is too old or missing checking for arm-apple-darwin-strip... no checking for strip... strip checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for arm-apple-darwin-gcc... -arch armv7 -isysroot checking whether the C compiler works... no configure: error: in
/Users/vuonghaithanh/WebstormProjects/testreact/node_modules/react-native/third-party/glog-0.3.4':
configure: error: C compiler cannot create executables
See config.log' for more details
pls help me how to fix
react-native-cli: 2.0.1 react-native: 0.53.3
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/
Solved the problem on MacOS
@coicoichip did you manage to solve your problem ?
After upgrading from
0.44.3
->0.45.0
, XCode no longer builds for me with the following error:I am not using cocoa pods, just npm packages. Seems like some related changes have been made that may be causing this issue?