1. 程式人生 > >React-Native Issue: PCH was compiled with module cache path

React-Native Issue: PCH was compiled with module cache path

最近React-Native專案中發現一個奇怪的問題:

當執行:

react-native run-ios

的時候,發生如下錯誤:

PCH was compiled with module cache path '/Users/tyler/workspace/html5space/HappyTime/ios/build/ModuleCache/HST39TUTS9TS', but the path is currently '/Users/tyler/workspace/webstormspac/react-native-template/ios/build/ModuleCache/HST39TUTS9TS'
react-native AppDelegate.m
normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler

因為這個ios工程我在本地複製貼上過,也就是說工程位置轉移了,之前是沒有問題的。在新的工程位置執行命令才發生此問題。

探索一番,找到了解決方案:

首先我們在ios工程目錄下找到這個資料夾:

這裡寫圖片描述

刪除ModuleCache檔案,然後重新執行:

react-native run-ios

即可成功執行,build success!