Cannot generate iOS App archive in xcode
I did the following to make it work for me:
- I had a three20 static library, I used cocoapods to include the files within the main project
- followed the skip install for all other sub projects/static libraries and switched the copy headers from public to project as stated above
- most importantly: in each library your project uses go to build phases -> Copy Files and ensured that destination is changed from
Absolute path
toproducts directory
. Note: see the hint below to narrow your search to find the library causing this error.
and that was it!
hint: to get an idea of the offending files that's causing your archive to create an archive file rather than an ipa do this:
- Select the archive and click the Distribute button.
- Select the 'Save Built Products' option.
- Hit Next and Save.
- Browse the created directory in Finder.
- The 'libraries' subdirectory will identify the libraries that you need to set the Skip Install to Yes.
- in some cases
usr/local/include
will identify the culprit header files you need to move from Public to Project or the files that you have to change from absolute path to products directory (or even the files you forgot to set the skip install to yes flag). but that directory (ie usr/local/include) varies depending on your sublibrary directory structure. In many cases.. you will see all the files listed under Copy Files in step 3 above listed here. If you find them here, then you have a definite answer for the cause of your problem.
update to hint: to make life even more simpler.. whatever files appears under step 4 in hint above.. simply search for it in the global search of xcode.. and you should get immediate results for what you want.. for example, this was the content of my folder (following the steps in hint above):
So I could tell it has something to do with the crypto and ssl libraries.. searching for them:
made me realize that i forgot to set skip install to yes.
This can happen if you've added a framework/library ... you need to edit the Target->Build Settings of that library and set the 'Skip Install' setting to 'Yes'. When you re-archive, XCode should start producing a 'iOS App Archive' again rather than a 'generic xcode archive'.
Check Build Settings:
- Skip install is NO for the main project target
- Skip install is YES for framework (sub-projects) targets
- In Build Phases for sub-projects, Copy Headers needs to be in Project, not Public (does not apply if building static library)
- Installation Directory under Deployment is valid (/Applications for example)
In addition of Skip Install to Yes and in case you opened another lib/framwork project within your app project you have to move headers (if any) from public to project in the Build Phase / Copy Headers.