[日常除虫]解决方案:The file couldn't be opened because you don't have permission to view it

今天clean了一下工程,然后run就出现了下面的问题

[日常除虫]解决方案:The file couldn't be opened because you don't have permission to view it_第1张图片

    通过百度一搜索,发现遇到此类问题的同学还不少,这里我总结了

一下解决方法。


方法一:查看工程中警告,发现需要更新旧工程的设置:

点击Upate to reconmmented settings,打开如下窗口:

[日常除虫]解决方案:The file couldn't be opened because you don't have permission to view it_第2张图片

选择Perform Changes,再次运行 就ok了。[转载]Xcode6:The file couldn’t be opened because you don’t have permission to view it - 笑意的日志 - 网易博客


方法二:Project---Build Setting中 修改这一项,变成Default Compiler(Apple LLVM 7.1)

[日常除虫]解决方案:The file couldn't be opened because you don't have permission to view it_第3张图片

搞定。



方法三:直接product -clean一下就ok.

[日常除虫]解决方案:The file couldn't be opened because you don't have permission to view it_第4张图片

方法四:清除缓存


[日常除虫]解决方案:The file couldn't be opened because you don't have permission to view it_第5张图片
[日常除虫]解决方案:The file couldn't be opened because you don't have permission to view it_第6张图片
[日常除虫]解决方案:The file couldn't be opened because you don't have permission to view it_第7张图片

xcode->preferences->Derived Data  .然后删除这个Derived Data文件夹。再command+shift+K Clean一下  然后command+ R。


方法五:把info.list的Executable file 与building set 中的product_name改成一致,例如都为$(PRODUCT_NAME)


方法六:这个方法解决了我的问题。这里有个细节,我门从工程外导入文件时,如果如下面勾选

[日常除虫]解决方案:The file couldn't be opened because you don't have permission to view it_第8张图片

则导入的文件会变蓝色

,然后run的时候就出现了这个问题。我换了一种方式,重新导入文件

[日常除虫]解决方案:The file couldn't be opened because you don't have permission to view it_第9张图片

然后导入的文件为黄色

然后就可以顺利run了,问题解决!猜测此问题的出现,可能是因为勾选folder references一栏,只是单纯有引用,但文件路径不明确,没有实际加入到工程中来,所以造成问题。

总结,以上方法,都有人以此解决过提出的问题,一种不行就换另一种尝试,基本能解决问题。

你可能感兴趣的:([日常除虫]解决方案:The file couldn't be opened because you don't have permission to view it)