如何解决"找不到config.h文件"?从设备上的本机运行app时?

Gop*_*vra 9 android github ios react-native react-native-ios

获取错误"找不到Config.h文件,词法或预处理器错误."

我在xcode项目中运行设备中的应用程序.

我有谷歌,并找到了许多解决方案,但没有工作,我试过这个

https://github.com/facebook/react-native/issues/14382

当我尝试在iOS模拟器中运行时出现此错误

https://github.com/facebook/react-native/issues/10401

试图按照上面的网址但没有奏效.

请让我知道如何解决这个问题.谢谢

Vis*_*iya 15

试试吧

Open Terminal, go to your project’s root folder and do:
cd node_modules/react-native/third-party/glog-0.3.4/
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述 运行configure脚本:./ configure 在此输入图像描述 打开Xcode并尝试运行您的应用程序.

Xcode 10

"react-native": "0.57.5"

cd ./node_modules/react-native && scripts/ios-install-third-party.sh && cd third-party && cd $(ls | grep 'glog' | awk '{print $1}') && ./configure
Run Code Online (Sandbox Code Playgroud)


小智 0

只需进入 config.h 文件,单击右侧面板,然后通过检查正确的大小写将文件添加到应用程序目标。清理并再次编译。