Cannot generate iOS App archive in xcode
I have a problem generating a iOS App archive from an application. The application compiles just fine and even works in the simulator. Now I wanted to make som ad hoc testing and cannot generate the iOS App Archive. When I click on the Product -> Archive it generates a generic xcode archive. Can anyone help me. I should mention, that I have already generated an iOS App Archive of this application. It has just stopped to generate iOS Archive for some reason. Thanks a lot.
Solution 1:
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)
Solution 2:
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'.
Solution 3:
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.
Solution 4:
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.
Solution 5:
If you export the archive, open it and see /urs/local/include
in Products try this suggestion:
In each pod, under
Packaging
,Private Headers Folder Path
andPublic Headers Folder Path
is set to/usr/local/include
. If I clear them then I get a valid archive.
Worked for me after upgrading my React Native app to 0.11.0
, Xcode 7
and CocoaPods 0.39.0.beta.4
.