xcode is creating generic xcode archive instead of iOS App Archive

IosXcode

Ios Problem Overview


I'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.

Ios Solutions


Solution 1 - Ios

In my case problem was "Skip install" set to "NO" for one of embedded static libraries. Also useful link: https://developer.apple.com/library/mac/technotes/tn2215/_index.html

Solution 2 - Ios

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

Solution 3 - Ios

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.

Solution 4 - Ios

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

Solution 5 - Ios

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

I hope that helps!

Solution 6 - Ios

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

Solution 7 - Ios

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

Solution 8 - Ios

In XCode 5 the same error occurs if you have multiple targets and wrong checkmarks in Manage Schemes. Then Xcode puts 2 binaries into 1 Generic Archive. This does not affect checked in files into e.g. git!

Solution 9 - Ios

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

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

Best Luck & Cheer from KP :)

Solution 10 - Ios

I agree with @cat's response.

I by mistake had two build targets under manage scheme and that was the issue for me. Sip was NO already.

Checking this step can help you debug more if Skip is already set to no.

Solution 11 - Ios

I have this problem too. And I tried every solution here.

(This is a project in an xcode-workspace)

Finally I solved...... I clean everything in Derived data folder, close the workspace, then close Xcode, the open the single target project.

Then, I do archive, it makes an iOS App archive.

I hope I can help someone.

Solution 12 - Ios

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

Solution 13 - Ios

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.

Solution 14 - Ios

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.

Solution 15 - Ios

In my case none of the suggested solutions worked as the project file was fine. I simply had to remove everything in the Derived Data folder and things got back to normal. You can find it from the Preferences > Locations.

I think this was due to the new Xcode 6. I was previously using the beta.

Solution 16 - Ios

After trying all of the other suggestions (checking that the build is single-target, clearing the Derived Data folder, closing and reopening Xcode, etc), I have found that rebooting the system resolves this issue each time. I have also found rebooting has solved some other Xcode oddities in the past such as it suggesting it could not find certain system framework header files.

The only suggestion I found above that did allow me to build the correct archive without rebooting was to close the Xcode Workspace and to open the individual Xcode Project from the Workspace, and to build the archive for that one Project. The reboot however was the only option I found that restored normal behavior for Xcode to be able to build the correct archives from within the multi-project Workspace.

I have found the reboot to resolve Xcode issues on a system running OS X 10.11.6 and Xcode 8.2.1 - hopefully the reboot resolves the issue on newer systems too and helps others who may be dealing with this odd issue.

Solution 17 - Ios

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

For more details on the issue check this post

Solution 18 - Ios

I had to do things:

  1. go to Product -> Schemes -> Manage : Here make sure that only one scheme is selected and that is your current scheme

  2. go to Product -> Schemes -> Edit: there are options such as this : Make sure only only one archive is selected.enter image description here

Solution 19 - Ios

My issue started after a pod install, problem went away after updating cocoapods (from 0.38 to 0.39) and running pod install again.

Solution 20 - Ios

This helped for me (2018 year)

  • gem install cocoapods --pre
  • pod 1.5.0.beta.1 update Check
  • shared in scheme settings.

check shared

Solution 21 - Ios

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.

Solution 22 - Ios

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!

Solution 23 - Ios

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

Solution 24 - Ios

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

Solution 25 - Ios

In my case, none of the solutions worked, because the root cause for me was different. I was using SPM and had a .xcdatamodel in my Swift Package. Removing it resolved the issue.

Solution 26 - Ios

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

Solution 27 - Ios

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.

Solution 28 - Ios

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.

Solution 29 - Ios

I had the same problem in my tvOS app.

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

Screenshot

Solution 30 - Ios

Make sure that you have the Build field set under Project Settings > General.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKalpesh PanchasaraView Question on Stackoverflow
Solution 1 - IosAlexeyVMPView Answer on Stackoverflow
Solution 2 - IossomasekharView Answer on Stackoverflow
Solution 3 - IosGot99ErrorsView Answer on Stackoverflow
Solution 4 - IosBenkaxView Answer on Stackoverflow
Solution 5 - IosKasasView Answer on Stackoverflow
Solution 6 - IosNianliangView Answer on Stackoverflow
Solution 7 - IosYhondriView Answer on Stackoverflow
Solution 8 - IoscatView Answer on Stackoverflow
Solution 9 - IosKalpesh PanchasaraView Answer on Stackoverflow
Solution 10 - IoshelloWorldView Answer on Stackoverflow
Solution 11 - Iosuser9527View Answer on Stackoverflow
Solution 12 - IosJulesView Answer on Stackoverflow
Solution 13 - IospossenView Answer on Stackoverflow
Solution 14 - IosG.SwiftView Answer on Stackoverflow
Solution 15 - IosmkkoView Answer on Stackoverflow
Solution 16 - IosbluebinaryView Answer on Stackoverflow
Solution 17 - IosSadanandView Answer on Stackoverflow
Solution 18 - Iosdaksh_019View Answer on Stackoverflow
Solution 19 - IosalparsonsView Answer on Stackoverflow
Solution 20 - IosNike KovView Answer on Stackoverflow
Solution 21 - IosKRS1View Answer on Stackoverflow
Solution 22 - IossebastienhamelView Answer on Stackoverflow
Solution 23 - IosaceciliaView Answer on Stackoverflow
Solution 24 - IosVinay PodiliView Answer on Stackoverflow
Solution 25 - IosAswathView Answer on Stackoverflow
Solution 26 - IosDrew ReeseView Answer on Stackoverflow
Solution 27 - IosKirill KuzykView Answer on Stackoverflow
Solution 28 - IosGuilherme MunizView Answer on Stackoverflow
Solution 29 - IoszuziaaaxView Answer on Stackoverflow
Solution 30 - IosJosep AlsinaView Answer on Stackoverflow