2017-07-13 38 views
5

獲取錯誤「找不到Config.h文件,詞法或預處理器錯誤。」如何解決「找不到config.h文件」?當從設備上的原生應用程序運行應用程序?

我在xcode項目中運行設備中的應用程序。

我有谷歌,發現了很多解決方案,但都沒有奏效,我想這

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

,當我嘗試到了iOS模擬器中運行收到此錯誤

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

試圖按照上述網址,但沒有奏效。

請讓我知道如何解決這個問題。 謝謝

回答

0

只需進入config.h文件,單擊右側面板並通過檢查正確的大小寫將文件添加到應用程序目標。清理並重新編譯。

3

我面臨着同樣的問題,它的固定這些命令: -

rm -rf node_modules/ 
yarn clean cache 
yarn install 

NPM

rm -rf node_modules/ 
npm cache clean 
npm i 
+0

這個固定我的問題。但是,我不得不使用'清潔紗線緩存'。我可能會使用不同版本的紗線。 –

+0

爲我工作。 (Y) – Xeieshan

+0

謹慎清潔紗線:'''注意:該命令僅適用於高級用例。除非您作爲node_modules的一部分安裝的文件數量遇到 問題,否則不建議使用 以使用此命令。它使用啓發式識別可能不是從分佈式軟件包中需要的文件,並且可能不是完全安全的.''' https://github.com/yarnpkg/yarn/issues/2206 –

3

嘗試

Open Terminal, go to your project’s root folder and do: 
cd node_modules/react-native/third-party/glog-0.3.4/ 

enter image description here 運行配置腳本: ./configure enter image description here 打開Xcode並嘗試運行您的應用程序。

1

對於我來說:

# rm -rf node_modules 

# npm cache verify (Because I'm using npm version 5.0.3) 

# npm install 

Xcode Clean 

Xcode Run 

如果不工作,

在終端,導航到react-native/third-party/glog foldernode_modules

(對我來說,這是cd node_modules/react-native/third-party/glog-0.3.4

一旦在此文件夾中,

#run ../../scripts/ios-configure-glog.sh 

出入記錄配置和Xcode創建所需config.h頭文件中找到

相關問題