打开模块“Swift"的导入文件:权限被拒绝 [英] Opening import file for module 'Swift': Permission denied

查看:21
本文介绍了打开模块“Swift"的导入文件:权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如标题所示,我目前面临一个问题,即我试图将 Swift 文件添加到我的 ObjC 项目中.生成桥接标头,一旦我尝试构建,它就会因错误而停止:

As the title shows, I'm currently facing a problem in which I'm trying to add a Swift file to my ObjC project. The bridging header is generated and as soon as I'm trying to build, it stops with the error:

<unknown>:0: error: opening import file for module 'Swift': Permission denied

这只发生在 1 个特定项目(这是一个旧应用程序,每年左右接收一次更新).较新的项目可以毫无问题地实现 swift 文件和构建.我已经比较了构建设置,但找不到任何差异(以及那些最终没有导致错误的差异).

This only happens with 1 specific project (which is an old app that has been receiving updates once every year or so). A newer project can implement the swift file and build without any problems. I've compared the build settings but couldn't find any differences (and the ones that were there, eventually didn't cause the error).

我尝试删除应用程序中所有与 Swift 相关的数据,并让它再次生成,但没有成功.我也尝试在 iOS8 和 8.1 上构建,但无济于事.

I've attempted to remove all the Swift related data in the app and let it get generated again, which didn't work. I've also tried to build on both iOS8 and 8.1, but to no avail.

我目前对导致它的原因一无所知,到目前为止我还没有在 StackOverflow 或 Google 上找到任何关于它的信息.

I'm currently out of ideas on what can cause it and I haven't been able to find anything on StackOverflow or Google in general about it so far.

推荐答案

我发现并最终使用的唯一方法是创建一个全新的 Xcode 项目并重组/导入旧文件.我在这个项目上花了一张 Apple 票,但他们也无法帮助我解决这个问题.

The only method I've found and eventually have used is by creating a completely new Xcode project and restructuring/importing the old files. I've spent an Apple ticket on this project, but they haven't been able to help me out with this problem either.

所以,我对此的回答是;如果过时而无法实现 Swift,请创建一个新的 Xcode 项目.

So, my answer to this is; Create a new Xcode project if it's too outdated to implement Swift.

这篇关于打开模块“Swift"的导入文件:权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆