Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6.01 Archive validation error: Invalid Segment Alignment

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:

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.

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.

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)

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!

like image 767
fat32 Avatar asked Oct 04 '14 07:10

fat32


3 Answers

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.

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)

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)

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

like image 83
fat32 Avatar answered Nov 16 '22 00:11

fat32


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).

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

like image 2
cohen72 Avatar answered Nov 16 '22 00:11

cohen72


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)

Hope this helps someone

like image 1
Maslow Avatar answered Nov 16 '22 01:11

Maslow