Xcode 6.01 存档验证错误:无效的段对齐

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

Xcode 6.01 Archive validation error: Invalid Segment Alignment

iosobjective-cxcode

提问by fat32

I have been working on an iOS project solely in Xcode. Deployment target is iOS 8.0. After updating to Xcode 6.x, building and testing on my iPhone 5s and iPhone 6 as well as the simulators works fine. However, when I create an archive and want to validate it, I get the following error:

我一直在单独使用 Xcode开发一个 iOS 项目。部署目标是 iOS 8.0。更新到 Xcode 6.x 后,在我的 iPhone 5s 和 iPhone 6 以及模拟器上构建和测试工作正常。但是,当我创建存档并想要对其进行验证时,出现以下错误:

Archive validation failed due to the issues listed below.

iTunes Store operation failed. Invalid Segment Alignment. This app does not have proper segment alignment and should be rebuilt with the latest version of Xcode. Please contact Developer Technical Support if you need further assistance.

由于下列问题,存档验证失败。

iTunes Store 操作失败。无效的段对齐。此应用程序没有正确的段对齐,应使用最新版本的 Xcode 重建。如果您需要进一步的帮助,请联系开发人员技术支持。

I have googled for the past couple of days and it seems that this problem mostly occurs in connection with other development tools, especially from Adobe. However, I have only used Xcode for development.

过去几天我在谷歌上搜索,似乎这个问题主要与其他开发工具有关,尤其是来自 Adob​​e。但是,我只使用Xcode进行开发。

This is what I have tried so far:

这是我迄今为止尝试过的:

  • Reinstalling Xcode 6.01
  • Turning Autolayout on and off
  • Set target from 8.0 to 7.1
  • Just submit the archive (no error message, but new version is not found in Testflight)
  • 重新安装 Xcode 6.01
  • 打开和关闭自动布局
  • 将目标从 8.0 设置为 7.1
  • 只需提交存档(没有错误消息,但在Testflight中找不到新版本)

Unfortunately, none of this has worked. My questions:

不幸的是,这些都没有奏效。我的问题:

  • What does the error message want to tell me?
  • Has anyone any idea how to solve this problem?
  • 错误信息想告诉我什么?
  • 有谁知道如何解决这个问题?

Thanks a lot!

非常感谢!

回答by fat32

I found the solution. XCode seems to have lost track of two of my files (XX.h and XX.c) This file name (with a .o extension) was in the summary of the 1st step of the validation.

我找到了解决方案。XCode 似乎丢失了我的两个文件(XX.h 和 XX.c) 这个文件名(带有 .o 扩展名)在验证的第一步的摘要中。

I removed the references to both files, added them again and everything works fine. Hope that helps someone!

我删除了对这两个文件的引用,再次添加它们,一切正常。希望对某人有所帮助!

(Edit: sorry, cannot flag this answer as the right answer, will do so in two days when stackoverflow lets me)

(编辑:抱歉,不能将此答案标记为正确答案,将在两天后 stackoverflow 允许我这样做)

More detailed instructions:

更详细的说明

  • When pressing "Validate" in the Organizer, look at the "Summary" dialog that pops up
  • If there are any .o files listed in addition to your app, go back to Xcode and remove the corresponding .h AND .m files from your project (removing the reference is sufficient)
  • Re-add them by dragging and dropping them back into your project
  • Recompile and it should work (assuming you're not using Adobe Air components in your app)
  • 在 Organizer 中按下“Validate”时,查看弹出的“Summary”对话框
  • 如果除了您的应用程序之外还列出了任何 .o 文件,请返回 Xcode 并从您的项目中删除相应的 .h 和 .m 文件(删除引用就足够了)
  • 通过将它们拖放到您的项目中来重新添加它们
  • 重新编译它应该可以工作(假设您没有在应用程序中使用 Adob​​e Air 组件)

(thanks a million for this post Fynh, your fix made it finally work for me!)

(感谢这篇文章 Fynh,你的修复使它终于对我有用了!)

回答by cohen72

In my case I was submitting an app that include a framework I had built that was a universal framework - created using lipo (for use with both device and simulator).

在我的情况下,我提交了一个应用程序,其中包含我构建的框架,该框架是一个通用框架 - 使用 lipo 创建(用于设备和模拟器)。

After replacing the universal compiled framework with device compiled framework, validation was successful.

将通用编译框架替换为设备编译框架后,验证成功。

回答by Maslow

To fix this bug I had to go Targets / Build Phases / Expand Copy Bundle Resources and remove the empty.cpp file (my error was about a empty.o file)

要修复此错误,我必须转到目标/构建阶段/展开复制捆绑资源并删除 empty.cpp 文件(我的错误是关于 empty.o 文件)

Hope this helps someone

希望这有助于某人