ios 构建项目时出错 Xcode 说:“您没有权限”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27355361/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 03:56:57  来源:igfitidea点击:

Error while build project Xcode says : "you don't have permission"

iosswiftiphonexcode

提问by jogshardik

I have downloaded one project from the internet and, when I am trying to run it/build it the XCode, XCode says :

我从互联网上下载了一个项目,当我尝试运行它/构建它时,XCode 说:

The file “PROJECT NAME” couldn't be opened because you don't have permission to view it.

无法打开文件“PROJECT NAME”,因为您没有查看它的权限。

I have also put read/write permission to the project folder as well but still not working.

我也对项目文件夹设置了读/写权限,但仍然无法正常工作。

Why does this is happen? Please help me to resolve this issue

为什么会发生这种情况?请帮我解决这个问题

回答by Michael Voznesensky

Go up to the folder containing the project in your Finder.

前往 Finder 中包含该项目的文件夹。

Right Click > Get Info

右键单击 > 获取信息

Go to the bottom of the Info pane, and click the little lock, type in your password when prompted.

转到“信息”窗格的底部,然后单击小锁,在出现提示时输入您的密码。

Then, change permissions for yourself to read+write.

然后,将自己的权限更改为读+写。

Click the little gear below, and apply to all enclosed items.

单击下面的小齿轮,并应用于所有封闭的项目。

Close the lock once you are finished!

完成后关闭锁!

If this doesn't work, Change the value of "Compiler for C/C++/Objective-C" to "Default Compiler (Apple Clang)" under the Build Settings of your target.

如果这不起作用,请在目标的构建设置下将“Compiler for C/C++/Objective-C”的值更改为“Default Compiler (Apple Clang)”。

回答by jogshardik

The project i have download from the internet don't have the Executable file in info.plist which should be there and its value should be this ${EXECUTABLE_NAME}. Instead of this value it consist some different value. So i have changed it ${EXECUTABLE_NAME} this value then clean->build->run successfully.

我从互联网上下载的项目在 info.plist 中没有可执行文件,它应该在那里,它的值应该是 ${EXECUTABLE_NAME}。它包含一些不同的值,而不是这个值。所以我已经改变了它 ${EXECUTABLE_NAME} 这个值然后 clean->build->run 成功。

回答by Anish Parajuli ?

None of the answers helped me. Although the build was successful i got the error while trying to run the project. Accidentally while cloning the project, there were no files under the Build Phases -> Compile Sources.This might have happened while working on a team in git.

没有一个答案对我有帮助。尽管构建成功,但我在尝试运行项目时遇到了错误。不小心在克隆项目时,在 Build Phases -> Compile Sources 下没有文件。这可能是在 git 团队中工作时发生的。

Files under compile sources may be the entry point to be able to build/run the project.

编译源下的文件可能是能够构建/运行项目的入口点

enter image description here

在此处输入图片说明

Once i added the AppDelegate& ViewControllerfile in compile sources i was able to run the project without any error.

一旦我在编译源中添加了AppDelegate&ViewController文件,我就能够运行该项目而没有任何错误。

enter image description here

在此处输入图片说明

回答by Sudhin Davis

Take your Projects build Setting

获取您的项目构建设置

In Architecture section make sure that Architectures and Valid Architectures are the same. If any extra Architecture is present in Valid Architecture section please remove it and then try building the code, It will work. enter image description hereHere in the image edit the section marked as red.

在架构部分确保架构和有效架构相同。如果有效架构部分中存在任何额外的架构,请将其删除,然后尝试构建代码,它将起作用。 在此处输入图片说明在图像中编辑标记为红色的部分。

回答by vishal dharankar

I had similar issue ad problem was there was an info.plist file in one of the folder in framework that i downloaded from GitHub , deleting it fixed the issue

我有类似的问题广告问题是我从 GitHub 下载的框架文件夹之一中有一个 info.plist 文件,删除它可以解决问题

回答by Kakashi

I had the same problem. In my case, it caused from I try change display name's app from default to another by edit "Executable file" in Info.plit then compile, it will show this error. So I edit value property "Executable file" as default then edit value property "Bundle name" instead.

我有同样的问题。在我的情况下,它是由于我尝试通过编辑 Info.plit 中的“可执行文件”将显示名称的应用程序从默认更改为另一个,然后编译,它将显示此错误。所以我默认编辑值属性“可执行文件”,然后编辑值属性“捆绑名称”。

enter image description here

在此处输入图片说明

回答by Nicolas Buquet

I had the same error message wit ha project with Xcode 6.1.1.

我在 Xcode 6.1.1 的 ha 项目中遇到了相同的错误消息。

What I did to resolve it was the following:

我为解决它所做的如下:

  • in Build settings, "Architectures" section: set "Architectures" (ARCHS) to "Standard architectures (armv7, arm64)" for your target and/or project as needed.
  • in Build settings, "Build Options" section: set GCC_VERSION to "Default Compiler (Apple LLVM 6.0)" for project
  • 在构建设置的“架构”部分:根据需要将“架构”(ARCHS)设置为“标准架构(armv7,arm64)”以用于您的目标和/或项目。
  • 在构建设置中,“构建选项”部分:将 GCC_VERSION 设置为“默认编译器(Apple LLVM 6.0)”作为项目

I was able to launch and test the project with theses settings.

我能够使用这些设置启动和测试项目。

回答by Manuel BM

Clean the project inside Xcode.

清理 Xcode 内的项目。

Go to Product -> Clean

转到产品 -> 清洁

That worked for me.

那对我有用。

回答by Dorald

Select TARGETS -> General -> Identity -> Version (should be 1.0 or whatever version you want).

选择 TARGETS -> General -> Identity -> Version(应该是 1.0 或任何你想要的版本)。

回答by tesla

Doing a Product -> Cleanand deleting derived data then rebuilt project worked for me.

做一个Product -> Clean并删除派生数据然后重建项目对我有用。

The story is that I had 2 projects opened at same time. I've deployed first project on my device and after a while I was trying to deploy second one (initially stopped running first application), then got this ugly error message.

故事是我同时打开了 2 个项目。我已经在我的设备上部署了第一个项目,过了一段时间我试图部署第二个项目(最初停止运行第一个应用程序),然后收到了这个丑陋的错误消息。