首页 文章

找不到React Native Config.h

提问于
浏览
11

我是React本地开发人员的初学者 .

创建新项目后,打开它 .

xcode是 mutex.h 文件中找不到的显示错误 config.h 文件 . 我也在谷歌搜索并尝试可能的解决方案,但仍然显示相同的错误 .

我完成了以下命令

1

enter code hereenter code hereenter code here / usr / bin / ruby -e "$(curl -fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)"`

2

brew install watchman

3

npm install -g react-native-cli

4

react-native init projectName

5

cd projectName
react-native start

6

react-native run-ios

CMD中的错误./Desktop/Demo React Native / projectName / node_modules / react-native / React /../ third-party / glog-0.3.4 / src / base / mutex.h:105:10:致命错误:找不到'config.h'文件包含“config.h”//找出pthreads支持1生成的错误 .

Software Version List
自制1.6.8
react-native-cli:2.0.1
反应原生:0.55
守望者4.9.0
npm 6.1.0

I'm also try this soluation but still error

在终端中,导航到 third-party/glogconfig glog 文件

cd node_modules/react-native/third-party/glog-0.3.4
./../scripts/ios-configure-glog.sh

4 回答

  • 41

    I got it fixed by following this steps:

    • 关闭 Xcode .

    • cd <Project-Folder>/node_modules/react-native/third-party/glog-0.3.4

    • 运行 ./configure

    • 运行 make

    • 运行 make install

    • 打开 Xcode 并尝试构建项目 .

    希望这能解决问题

  • 1

    解:

    yarn upgrade log
    

    升级到v1.6.0成功 . iOS构建成功 .

    注意:重建glog确实对我不起作用 . 构建失败 .

  • 0

    在项目目录中运行以下命令 . 帮我解决我的config.h未找到问题

    1.cd node_modules / react-native / third-party / glog-0.3.4 / 2. ./configure 3. make 4. make install 5. cd ../../../ .. 6. react-native运行IOS

  • 0

    我的问题来自于使用react-native@0.53.0,我认为新的Xcode版本有问题 .

    1 - Change react-native version in package.json

    "react-native": "0.53.0",
    

    "react-native": "0.56.0",
    

    2 - Remove node_modules folder

    $ rm -rf node_modules/
    

    3 - Reinstall modules:

    $ yarn install
    

相关问题