XCode:无法打开文件“[APP NAME].app",因为没有这样的文件 [英] XCode: The file “[APP NAME].app” couldn’t be opened because there is no such file

查看:38
本文介绍了XCode:无法打开文件“[APP NAME].app",因为没有这样的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就上下文而言,我在解决此问题后立即遇到此问题:

For context, I am encountering this immediately after resolving this issue:

Xcode错误:无法创建目录/[PATH_TO_APP]/[APP_NAME].app"(在项目[PROJECT]"的目标[TARGET]"中)

这是完整的错误详细信息文本(出于隐私原因在 [] 中进行了删节):

Here is the full error details text (with redactions in [] for privacy):

Details

The file "[APP NAME].app" couldn’t be opened because there is no such file.
Domain: NSCocoaErrorDomain
Code: 260
Failure Reason: The file doesn’t exist.
User Info: {
    NSFilePath = "/[APP NAME].app";
}
--
The operation couldn’t be completed. No such file or directory
Domain: NSPOSIXErrorDomain
Code: 2
Failure Reason: No such file or directory
--


System Information

macOS Version 10.15.5 (Build 19F101)
Xcode 11.5 (16139)

在项目文件夹中运行 ls -l 显示 [APP NAME].app 现在存在,但导航到相同位置并在 Finder 中选择文件显示划掉的圆圈"在应用程序的图标上.删除文件并再次构建会导致相同的结果.我也试过重命名项目并重新启动等,但无济于事.

Running ls -l in the project folder shows the [APP NAME].app now present, but navigating to the same location and selecting the file in Finder shows a "crossed out circle" over the app's icon. Removing the file and building again results in the same thing. I've also tried renaming the project and restarting, etc, to no avail.

推荐答案

NSFilePath = "/[APP NAME].app" 感觉像是缺少或拼写错误的环境变量.

NSFilePath = "/[APP NAME].app" feels like a missing or misspelled environment variable.

如果构建需要定义像 $(MyBuildDir) 这样的自定义环境变量,如果不是,则使用 $(MyBuildDir)/[APP NAME].app<运行命令/code> 将导致 "/[APP NAME].app"

If the build expects custom environment variable like $(MyBuildDir) to be defined, when it's not, then running a command with $(MyBuildDir)/[APP NAME].app would result in "/[APP NAME].app"

如果环境变量拼写错误也是如此.例如,使用 $(UBILD_DIR)/[APP NAME].app 而不是 BUILD_DIR 将导致 "/[APP NAME].app"代码>

The same is true for if the environment variable misspelled. For example, using $(UBILD_DIR)/[APP NAME].app instead of BUILD_DIR would result in "/[APP NAME].app"

这篇关于XCode:无法打开文件“[APP NAME].app",因为没有这样的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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