Pods-testAppTests/Pods-testAppTests.debug.xcconfig 的路径不正确:无法打开文件

Incorrect path for Pods-testAppTests/Pods-testAppTests.debug.xcconfig: unable to open file

所以我最近在 GitHub 上上传了我的 react-native 项目,然后将其克隆回来以查看它将如何构建(第一次这样做......是的)。在 react-native 运行-ios 上我得到了一个重复的错误: "react-native-app/ios/Pods/Target Support Files/Pods-testAppTests/Pods-testAppTests.debug.xcconfig: unable to open file (in target "testAppTests" in project "testApp") (in target 'testAppTests' from project 'testApp') 我找到了一个解决方案,其中:

cd ios
pod deintegrate
pod install

帮助我构建了项目并且 运行 正确。 所以我的问题是,如何以某种方式将它上传到 GitHub,以便它在克隆后始终正确构建?

更新

检查和编辑 .gitignore 解决了这个问题。

也许这链接到已经 added/committed 的文件,而它们本应被忽略,仅限私人和本地(未上传到 GitHub)

检查你的 .gitignore:这里是 one for ReactNative, as explained in "Creating a .gitignore for a Clean React Repository", blog post written by Parker Johansen.


然后,假设您没有任何待处理的 changes/work,您可以像 explained here 一样,将新的 .gitignore 应用到您现有的存储库:

cd /path/to/local/cloned/repo
# create your .gitignore
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
git push

最后再clone一次,看看能不能编译好。


OP 在评论中添加:

I found that folder 'Pods' doesn't exist on GitHub, that's why this error occurs, how can I add it to my /ios folder on Github correctly

我建议检查是否有 .gitignore 规则会忽略所述文件夹:

git check-ignore -v Pods/aFile_inside_Pods