xcode is creating generic xcode archive instead of iOS App Archive

 QuestionI'm a beginner in iPhone development and I tried to create an ipa with my profile and valid certificate but xcode is creating a generic xcode archive file instead of iOS app archive because in my code there are two .xcodeproj in there.

And from one of the stack overflow answer I followed the following steps:

  1. Skip install is NO for the main project target
  2. Skip install is YES for framework (sub-projects) targets
  3. Sub-projects need to have Copy Headers in Project not Public
  4. Installation Directory under Deployment is valid (/Applications for example)

But I'm still not getting the solution.



-------------------------------------------------------------------------------------------------------------------------------------

Answer 1 :

I tried everything suggested but it didn't work. But when I was trying to follow what @acecilia said I went to check my info.plist and the issue was my iOS target had a lot of stuff missing compared to the macOS info.plist.


I solved it by clicking on the Target, then Info on top, and matching my two info.plist and it finally let me Archive as an iOS build instead of a generic one.

-----------------------------------------------------------------------------------------------------------------------------------

Answer 2 :

I had the same problem in my tvOS app.

Solved it by disabling: "Build Documentation during 'Build'" flag in Build Settings.-----------------------------------------------------------------------------------------------------------------------------------

Answer 3 : 

I was using Unity and my case was that the Edit -> Project Settings... -> Player -> iOS -> Other Settings -> Target SDK was set as Simulator SDK. Changing to Device SDK created the app archive correctly. I hope it can help others struggling with it too.

-----------------------------------------------------------------------------------------------------------------------------------

Answer 4 :

In my case, the issue was that my app name started with DOT symbol. MacOS treats files and folders starting with '.' as hidden, so Xcode doesn't see there is an actual app inside the archive.

I develop my game in Unity, and this worked fine up until Unity 2020.1.17. Apparently, something has changed, and newer versions of Unity started to produce this issue.

-----------------------------------------------------------------------------------------------------------------------------------

Answer 5 :

Delete/Move Xcode Developer Directory

After going through and trying nearly every provided solution on stackoverflow, including fully re-installing Xcode, and cocoapods, what resolved this for me was completely deleting the ~/Library/Developer directory and letting Xcode recreate and populate it the next time I built/opened my project.

  1. Open Finder and select menu Go > "Go to Folder" and input "~/Library"
  2. Delete or move(archive somewhere just in case) the "Developer" directory
  3. Fully close out of Xcode and reopen project
  4. In Xcode Product > Archive
  5. This now created the correct iOS app archive and I was able to distribute and upload app to Testflight

-----------------------------------------------------------------------------------------------------------------------------------

Answer 6 :

My case is I got 2 target in the project, and once I set one of the target to Skip Install = "YES", the issue resolved

-----------------------------------------------------------------------------------------------------------------------------------

Answer 7 :

Finally I solved this kind of issue. I think this issue comes in different scenarios.

I got Generic Xcode Archive Type. After that, generated archive build with distribute content.

Actually, In my case the issue with subproject header files path, I believe their path was missing while archiving.

I have tried, removed subproject references and added again. I have already set header search path correctly, Identified, paths were pointing to different folder location earlier under subproject. After added, it was pointing exact folder.

After that I tried archive and generated Archive build with distribute App option. Finally able to get iPa file and pushed to iTunes Connect :).

This may helpful for someone.

Thanks

-----------------------------------------------------------------------------------------------------------------------------------

Answer 8 :

For me, Xcode was creating a generic Xcode archive because I was lacking the UISupportedInterfaceOrientations field in my Info.plist. After adding it, the app archive was created correctly

-----------------------------------------------------------------------------------------------------------------------------------

Answer 9 :

None of the above answers worked for me, once I followed Apple's Tech notes I started getting lot of linking errors and headers not found errors.

I tried solving those errors and no solutions worked for me, tried playing with header search paths, library search paths etc.

Finally if none of these solution works, kindly follow below steps to submit your app to app store

With XCode 11.x.x

  1. Essentially, after you do the Clean Build Folder, and then Build, you find the .app file in: ~/Library/Developer/Xcode/DerivedData//Build/Products/Release-iphoneos/

  2. Create a new folder on your desktop named Payload (this name is case-sensitive)

  3. Copy your .app file and paste the copy in this Payload folder.

  4. Right click the folder and choose “Compress Payload”

  5. When you save this, do not save it with the .zip extension, but instead save it with a .ipa extension.

  6. This is now your .ipa file for your app, and you can upload this through Xcode Transporter App

If you are still on older version of Xcode 10.x.x then follow same steps as given above but just change last step, instead of transporter app, use Application Loader App

-----------------------------------------------------------------------------------------------------------------------------------Answer 10 :

In XCode 11, in my case it was none of the aboves. I had some HTML files that were part of my target ("Target Membership") once I removed them, I was able to generate the proper archive.

Basically, just make sure that you don't put wrong files in the target.

Hope it helps!

-----------------------------------------------------------------------------------------------------------------------------------

Answer 11 :

I was using cocoa-pods and when you go to manage schemes the Container was set to the xcodeproj instead of the xcworkspace. When set to xcworkspace it worked.

-----------------------------------------------------------------------------------------------------------------------------------

Answer 12 :

In my case issue was in a scheme. I had two targets marked as "Archive". This happened when I duplicated one of my targets.

In Scheme -> Build -> Targets I just remove this one which I do not want, after that archive is in "iOS Apps" instead of "Other Items" section.

-----------------------------------------------------------------------------------------------------------------------------------

Answer 13 :
Turns out I had two app targets in my scheme. I saw when I built, the products folder ended up with two apps. There were two versions of the app in the same bundle. Following @Got99Errors' suggestion of checking the package contents. I removed the second target from the Build scheme and the problem was resolved.

-----------------------------------------------------------------------------------------------------------------------------------

Answer 14 :
I had a problem with Cocoapods 0.38.1, after upgrading some projects it was generating me the xCode Generic Archive... after following all the steps the only way to create an ipa again was downloading cocoapods to 0.37.1 and following the steps on this link: http://9elements.com/io/index.php/cocoapods-best-practices/.

-----------------------------------------------------------------------------------------------------------------------------------

Answer 15 :

One of cases is you have to move headers (if any) from Public to Project in the Build Phase / Headers.

https://developer.apple.com/library/content/technotes/tn2215/_index.html#//apple_ref/doc/uid/DTS40011221-CH1-PROJ

-----------------------------------------------------------------------------------------------------------------------------------

Answer 16 :

I know its late to reply, but yes i got the solution by following below steps:

  1. Go to Project NavigatorSelect Targets
  2. Go to Build Phases
  3. Check for Target Dependencies and remove it
  4. Clean & Build code
  5. Try to archive and you will get iOS app archive this time.

Best Luck & Cheer from KP :)

-----------------------------------------------------------------------------------------------------------------------------------

Answer 17 :

If you have any .xcodeproj files in Project>Targets>Build Phases>target dependencies remove it from there and then build your ipa. It works for me. Cheers

-----------------------------------------------------------------------------------------------------------------------------------

Answer 18 :

The problem that I had was CocoaPods version 0.38.2., after upgrade CocoaPods to the later version (0.39.0.beta.4) all works fine.

$gem install cocoapods --pre

Then:

$pod update

---------------------------------------------------------------------------------------------------------------------------

Answer 19 :

None of these worked for me, it was cocoapods in my case, had to uninstall all and install the release version


sudo gem uninstall cocoapods

sudo gem uninstall cocoapods-core

sudo gem uninstall cocoapods-downloader

sudo gem install cocoapods


---------------------------------------------------------------------------------------------------------------------------

Answer 20 :

My case wasn't 'skip install' nor a cocoapods issue. It appears that one of the 3rd party frameworks which I ended up not using was the cause for this. The solution was simply removing it.


In order to track this issue I right clicked the generic archive file in 


Xcode's organizer and selected 'show in finder' -> right click the archive file -> select Show Package Contents -> Products -> Applications and inside this folder you can see what other files are in it besides the {project-name}.app file. 


In my case there was a file with the prefix of the framework I wasn't using, which led to its removal from the project's workspace.


Comments