'config.h' file not found'和/Libraries/WebSocket/libfishhook.a'-Xcode10,React-Native更新問題

1.React Native 中在xcode10運行提示 ‘config.h’ file not found’

在這裏插入圖片描述
解決方法:
在項目終端執行以下命令

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

clean the project and build again, the error is gone,也可以參見github中的處理意見:config.h’ file not found
其實執行 .sh 命令之後Terminal界面的一些處理流程,我們不難看出,這個命令是check .h頭文件的引用情況,然後重新建立關聯關係

2.Build input file cannot be found: ‘…/node_modules/react-native/Libraries/WebSocket/libfishhook.a’

解決方案:
按照1-2-3步驟進行先刪除掉libfishhook.a文件,然後再重新加入即可
在這裏插入圖片描述

3.Xcode10構建方式切換,使用舊的構建方式

由於Xcode10會默認使用新的構建方式,感覺不是很順手,於是我們需要切換到舊的構建方式,構建方式如下:
File->Project Settings->Build Systems 選擇Legacy Build System
在這裏插入圖片描述

4.Could not find iPhone 6 simulator

在升級完系統之後,使用react-native run-ios命令進行打開模擬器時,會提示該Could not find iPhone 6 simulator

react: 16.0.0 => 16.0.0
react-native: 0.51.0 => 0.51.0
Xcode: Xcode 11.2 Build version 11B52

解決方案:
1.進入打開findMatchingSimulator文件

cd ./node_modules/react-native/local-cli/runIOS

打開文件findMatchingSimulator.js,然後替換內容。
第一步替換:

    if (version.indexOf('iOS') !== 0) {
       continue;
     }

    if (!version.includes('iOS')) {
      continue;
    }

第二步替換:

      if (simulator.availability !== '(available)') {
        continue;
      }

      if (simulator.isAvailable !== true) {
        continue;
      }

替換之後,重新運行react-native run-ios即可正常運行


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章