Xcode 未构建包含更改的应用程序

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

Xcode not building app with changes incorporated

iphonexcodeosx-lion

提问by user955853

After upgrading to Lion, Xcode 4.1 is no longer building my iOS apps with the latest changes incorporated (i.e code, bundle name, icon changes).

升级到 Lion 后,Xcode 4.1 不再构建包含最新更改(即代码、包名称、图标更改)的 iOS 应用程序。

Before the upgrade, when I was using Snow Leopard, no matter what the change, or even if I replaced a file outside of Xcode with Finder or used an external text editor, Xcode would always build a fresh copy with all of the changes incorporated, without having to do any extra steps.

在升级之前,当我使用 Snow Leopard 时,无论发生什么变化,或者即使我用 Finder 替换 Xcode 外部的文件或使用外部文本编辑器,Xcode 总是会构建一个包含所有更改的新副本,无需执行任何额外步骤。

Now, Xcode seems to insist on using a previous version, and the only way I can be sure that it will build with all of the changes incorporated is do a Product > Clean from the main menu and then restart Xcode.

现在,Xcode 似乎坚持使用以前的版本,而我可以确定它将在包含所有更改的情况下构建的唯一方法是从主菜单执行 Product > Clean,然后重新启动 Xcode。

What's going on here? Is there a simple setting that I am missing? I never had to anything except click Run when I was on Snow Leopard, and all changes were always incorporated without a glitch. If I can't fix this I am going to revert to Snow Leopard.

这里发生了什么?是否有我缺少的简单设置?当我在 Snow Leopard 上时,除了单击 Run 之外,我什么都不用做,而且所有更改始终都没有出现故障。如果我不能解决这个问题,我将恢复使用 Snow Leopard。

回答by Prajoth

Delete the "Build" folder in your app's folder on your computer and try running the app again. That should fix it.

删除计算机上应用程序文件夹中的“Build”文件夹,然后再次尝试运行该应用程序。那应该解决它。

回答by El Developer

Lion is known to have this issues with Xcode. I solved this by installing the newest beta available. If you don't have access to the newest beta try uninstalling and reinstalling. To uniinstall:

众所周知,Lion 在 Xcode 上有这个问题。我通过安装可用的最新测试版解决了这个问题。如果您无权访问最新的测试版,请尝试卸载并重新安装。卸载:

sudo /Developer/Library/uninstall-devtools --mode=all

须藤/Developer/Library/uninstall-devtools --mode=all

回答by temple

Go the folder

去文件夹

/Users/%yourusername%/Library/Developer/Xcode/DerivedData/%yourworkplacename%/Build/Intermediates/

/Users/%yourusername%/Library/Developer/Xcode/DerivedData/%yourworkplacename%/Build/Intermediates/

delete the projects that you want them to rebuild.

删除您希望它们重建的项目。

It works for me to make the modified file take in effect after I run it.

它对我有用,使修改后的文件在我运行后生效。

回答by Gourav Joshi

I faced same problem and I solved this.

我遇到了同样的问题,我解决了这个问题。

On creating build and after installation of app if you don't get the changes that you made in it, means '.app' was not updated properly.

在创建构建和安装应用程序后,如果您没有得到您在其中所做的更改,则意味着“.app”未正确更新。

To fix this problem:->

要解决此问题:->

First delete '.app' from project in Product folder and then make archive (Xcode-> Menu Bar-> Product-> Archive, we dont do any thing of this archive, Now close that organizer window)

Now clean your project and then make build by taping build option. Now build is updated with your latest work.

首先从产品文件夹中的项目中删除“.app”,然后进行存档(Xcode-> 菜单栏-> 产品-> 存档,我们不对这个存档做任何事情,现在关闭该管理器窗口)

现在清理您的项目,然后通过点击构建选项进行构建。现在 build 已更新为您的最新作品。

回答by CIFilter

I've experienced plenty of issues with taking "old" projects into newer versions of Xcode. If it's not TOO painful, I'd make a new project and just add all your classes and resources to it to make sure it's fresh for Xcode. This isn't trivial in some cases, but it's more likely to fix your issue.

我在将“旧”项目引入较新版本的 Xcode 时遇到了很多问题。如果它不是太痛苦,我会创建一个新项目并将您所有的类和资源添加到其中以确保它对 Xcode 来说是新鲜的。这在某些情况下并非微不足道,但更有可能解决您的问题。

回答by karel

Had a similar effect where every change appeared to be ignored, Xcode said it compiled but the simulator showed a previous version. Even when I did a clean and rebuild. The problem was in the simulator, I noticed 2 icons of the same project. I uninstalled them both in the emulator and run it again, this time correctly with all my changes. Guess the problem appeared because of changes in the name of the project bundle, this must have confused the simulator. so deleting the apps in the simulator did the trick.

有一个类似的效果,每个更改似乎都被忽略了,Xcode 说它编译了,但模拟器显示了以前的版本。即使我做了清理和重建。问题出在模拟器中,我注意到同一个项目的 2 个图标。我在模拟器中卸载了它们并再次运行它,这一次我的所有更改都正确。猜测是因为项目包的名称发生了变化而出现的问题,这一定是模拟器混淆了。所以删除模拟器中的应用程序就成功了。