configure:错误:C编译器无法创建可执行文件 - React Native

Anj*_*nju 17 xcode react-native

我一直在尝试构建我的反应原生项目,但收到错误

反应原生版本:.48.4

Xcode:9.1

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... /opt/Xilinx/SDK/2017.1/gnu/arm/lin/bin/arm-xilinx-linux-gnueabi-gcc
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
Run Code Online (Sandbox Code Playgroud)

小智 32

这为我解决了这个问题

rm -r ~/.rncache/
cd node_modules/react-native/third-party/glog-0.3.4/
./configure --host arm-apple-darwin
Run Code Online (Sandbox Code Playgroud)


Guy*_*Guy 17

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/
Run Code Online (Sandbox Code Playgroud)

解决了这个问题

  • 我将应用程序名称从Xcode 9更改为Xcode并运行此命令.这对我有用.谢谢 :-) (4认同)
  • 我建议从应用程序名称中删除空格,因为它可能会导致另一个问题:``Xcode 12.0.app`` -> ``Xcode_12.0.app`` 因此命令如下所示:``sudo xcode-select -s / Applications/Xcode_12.0.app/Contents/Developer/`` 没有任何空格是路径。 (2认同)

小智 7

我遇到过同样的问题,

以下步骤对我有用,

  • 重启你的系统
  • 在 repo 下:cd node_modules/react-native/third-party/glog-0.3.4
  • ../../scripts/ios-configure-glog.sh


Jar*_*yth 7

来自此评论:配置:错误:C 编译器无法创建可执行文件-React Native

从更改应用程序的名称~/Downloads/Xcode 10.1.app,以~/Downloads/Xcode.app固定的这个问题对我来说。我想知道它是否与应用程序名称中的空格有关?