xcode“无法打开文件”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34125801/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
xcode "The file couldn't be opened"
提问by Harry
I am using ionic
to develop an app and everything had been working fine for some time.
我正在ionic
开发一个应用程序,并且一切都运行良好有一段时间了。
However, I have recently updated to xcode 7.x so that I can compile for iOS 9. Now, when I run ionic prepare ios
to generate the ios platform files and click on the *.xcodeproj
file, I get the following error:
但是,我最近更新到了 xcode 7.x,以便可以针对 iOS 9 进行编译。现在,当我运行ionic prepare ios
生成 ios 平台文件并单击该*.xcodeproj
文件时,出现以下错误:
The file couldn't be opened.
The file can open just fine in xcode 6.x
该文件可以在 xcode 6.x 中正常打开
I need it to work in xcode 7.x for the app to build with later SDK versions
我需要它在 xcode 7.x 中工作才能使用更高版本的 SDK 构建应用程序
Side note: I have searched for answers to this issue but in other cases the error message is more descriptive. The error message I get does not give a reasonwhy it cannot be opened, be it permissions or parsing issues or otherwise, so I am stumped as to how to fix this. I have tried deleting (null) lines in files and deleting my <user>.xcuserdatad
files as suggested in these answers anyway to no avail.
旁注:我已经搜索了此问题的答案,但在其他情况下,错误消息更具描述性。我收到的错误消息没有给出无法打开的原因,无论是权限还是解析问题或其他问题,所以我对如何解决这个问题感到困惑。我已经尝试删除文件中的(空)行并<user>.xcuserdatad
按照这些答案中的建议删除我的文件,但无济于事。
- Cordova CLI: 5.4.1
- Gulp version: CLI version 3.9.0
- Gulp local: Local version 3.9.0
- Ionic Version: 1.1.0
- Ionic CLI Version: 1.7.12
- Ionic App Lib Version: 0.6.5
- ios-deploy-version: Not installed
- ios-sim version: 5.0.4
- OS: Mac OS X El Capitan
- Node Version: v4.2.4
- Xcode Version: Xcode 7.2 Build version 7C68
- 科尔多瓦 CLI:5.4.1
- Gulp 版本:CLI 版本 3.9.0
- Gulp 本地:本地版本 3.9.0
- 离子版本:1.1.0
- 离子 CLI 版本:1.7.12
- 离子应用程序库版本:0.6.5
- ios-deploy-version: 未安装
- ios-sim 版本:5.0.4
- 操作系统:Mac OS X El Capitan
- 节点版本:v4.2.4
- Xcode 版本:Xcode 7.2 构建版本 7C68
Question: why am I getting this error message and how I can fix it?
问题:为什么我会收到此错误消息以及如何修复它?
采纳答案by Harry
I have reinstalled El Capitan, xcode 7.2 and the necessary libraries (ionic, gulp, ..) and everything works fine now.
我已经重新安装了 El Capitan、xcode 7.2 和必要的库(ionic、gulp、..),现在一切正常。
Curious...
好奇的...
回答by Akash Singh
I had something similar after updating Xcode, the git command line tool won't work after updating, turns out I had to open the Xcode and accept the license for new Xcode after that everything worked fine.
更新 Xcode 后我有类似的东西,更新后 git 命令行工具将无法工作,结果我必须打开 Xcode 并接受新 Xcode 的许可证,之后一切正常。
回答by Enrique Oriol
I had the same problem, and it was caused by a different format of Xcode project file. If the project is compiled with the old Xcode, the new one cannot not open it.
我有同样的问题,它是由不同格式的 Xcode 项目文件引起的。如果项目是用旧的Xcode编译的,新的就打不开。
I suggest you to remove any build file to make sure that next time project is really compiled, and if problem persist, remove also the old version of Xcode, because it looks like it is the one used to compile the project.
我建议您删除任何构建文件以确保下次项目真正编译,如果问题仍然存在,请删除旧版本的Xcode,因为它看起来是用于编译项目的版本。
Alternatively, maybe ionic CLI has some option to select which Xcode it should use.
或者,也许 ionic CLI 有一些选项来选择它应该使用的 Xcode。
回答by arainone
2 possible solutions:
2种可能的解决方案:
1. Ionic configuration value
1. 离子配置值
It seems that somewhere in your project, a config value makes ionic still thinkyou use XCode 6 because you were using it before, and so continues to generate the project file accordingly.
What happens if you start over, in another directory, from a starter project file:
似乎在您的项目中的某个地方,配置值使 ionic 仍然认为您使用 XCode 6,因为您之前使用过它,因此继续相应地生成项目文件。
如果您在另一个目录中从初始项目文件重新开始,会发生什么情况:
ionic start myApp tabs
ionic prepare ios
Can you open the generated XCode project file? If yes, I suggest you to copy over this starter project all the files from your original project.
你能打开生成的 XCode 项目文件吗?如果是,我建议您将原始项目中的所有文件复制到此启动项目上。
2. Update nodeJs to the latest version
2.更新nodeJs到最新版本
I see you use node 4.x.x, try updating to 5.x.x.
我看到你使用节点 4.xx,尝试更新到 5.xx