简体   繁体   English

打开模块“Swift”的导入文件:权限被拒绝

[英]Opening import file for module 'Swift': Permission denied

As the title shows, I'm currently facing a problem in which I'm trying to add a Swift file to my ObjC project.正如标题所示,我目前面临一个问题,即我试图将 Swift 文件添加到我的 ObjC 项目中。 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

This only happens with 1 specific project (which is an old app that has been receiving updates once every year or so).这只发生在 1 个特定项目(这是一个旧应用程序,每年左右接收一次更新)。 A newer project can implement the swift file and build without any problems.较新的项目可以毫无问题地实现 swift 文件和构建。 I've compared the build settings but couldn't find any differences (and the ones that were there, eventually didn't cause the error).我已经比较了构建设置,但找不到任何差异(以及那些存在的差异,最终没有导致错误)。

I've attempted to remove all the Swift related data in the app and let it get generated again, which didn't work.我试图删除应用程序中所有与 Swift 相关的数据,并让它再次生成,但没有奏效。 I've also tried to build on both iOS8 and 8.1, but to no avail.我也尝试在 iOS8 和 8.1 上构建,但无济于事。

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.我目前对导致它的原因一无所知,到目前为止我还没有在 StackOverflow 或 Google 上找到任何关于它的内容。

The only method I've found and eventually have used is by creating a completely new Xcode project and restructuring/importing the old files.我发现并最终使用的唯一方法是创建一个全新的 Xcode 项目并重组/导入旧文件。 I've spent an Apple ticket on this project, but they haven't been able to help me out with this problem either.我在这个项目上花了一张 Apple 票,但他们也无法帮助我解决这个问题。

So, my answer to this is;所以,我对此的回答是; Create a new Xcode project if it's too outdated to implement Swift.如果太旧而无法实现 Swift,请创建一个新的 Xcode 项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM