59

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.

dasdom
  • 13,975
  • 2
  • 47
  • 58
Kalpesh Panchasara
  • 1,730
  • 2
  • 15
  • 27

31 Answers31

39

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

AlexeyVMP
  • 2,386
  • 3
  • 24
  • 31
  • 5
    Very good piece of advice. And yes, this document is a must read! – MonsieurDart Nov 20 '14 at 15:42
  • 1
    Thank you, mine too. I was embeding a launcher for my mac app and thought i know all the steps and didn't watched the tutorial again. – Cristi Băluță Mar 03 '17 at 05:09
  • 1
    This saved me when I had a Cocoa app that also had a stand-alone executable project in it. Had to set `Skip Install: Yes` on the executable or Xcode wouldn't build the archive correctly. Thank you *so* much! – CBHacking Aug 18 '17 at 19:27
  • 2
    That was my problem. One of my subprojects target had "skip install = NO". Changing it to YES solved the issue. – Benjamin Piette Mar 23 '18 at 13:37
  • 1
    Keep in mind that you could be linking multiple static libraries from a subproject. Make sure "Skip Install" is set to "NO" for all targets of each subproject. – Tyler Aug 10 '18 at 21:32
  • link to the document did help, problem solved, thanks – Sanjeevcn Dec 17 '18 at 11:51
  • 1
    for me even after making all static libraries "skip install = Yes" its still generating Generic Xcode Archive. Any inputs on this ? what else I have to check ? – Sadanand Aug 13 '19 at 05:03
13

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

somasekhar
  • 193
  • 1
  • 9
13

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.

Got99Errors
  • 328
  • 3
  • 11
  • 1
    The key for me was viewing the package contents and seeing another path to random headers in the Products dir. That showed me which 3rd party lib was responsible. – ecume des jours Oct 06 '15 at 11:48
12

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

Benkax
  • 919
  • 1
  • 7
  • 7
  • 2
    For me it was the scheme. Go to Manage Schemes, select the one you are trying to build, click edit and choose the left tab "Build". There I had all my targets.. after leaving only the one it worked. – amcastror Jun 21 '17 at 02:15
  • That was my problem. One of my subprojects target had "skip install = NO". Changing it to YES solved the issue. – Benjamin Piette Mar 23 '18 at 13:37
9

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!

Kasas
  • 1,216
  • 2
  • 18
  • 28
7

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

Nianliang
  • 2,926
  • 3
  • 29
  • 22
  • made my day! shapo! – Nikita Aug 23 '18 at 11:20
  • after doing this I started getting lot of compilation errors like headers not found, then I added header search paths manually and solved compilation error, but now getting lot of many linking errors like clang: error: no such file or directory: '/Users/user1/Library/Developer/Xcode/DerivedData/myapp-evvogrznnrakrpdflrddqvxxhzuh/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/BuildProductsPath/Release-iphoneos/libRCTFBSDK.a' – Sadanand Mar 05 '20 at 06:30
5

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
Apan
  • 1,027
  • 2
  • 10
  • 27
Yhondri
  • 837
  • 1
  • 9
  • 10
  • 2
    Thanks that was it! This bug got me again, upgraded OS X and had to re-install CocoaPods, old version. *rant* at this point Cocoapods costs me more time than it saves. How hard is it to download the source for those 4 pods I have and add it manually, and occasionally update it? Cocoa pods various bugs turn this into a time waster /rant – n13 Oct 10 '15 at 09:50
  • It is not difficult to install libraries (usually including the necessary classes to the project, it will be ok), the disadvantage is that you can be with bugs into the libraries until you upgrade it. – Yhondri Oct 10 '15 at 10:48
4

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!

cat
  • 2,871
  • 1
  • 23
  • 28
  • 1
    Then? Any idea what the exact fix is, totoro-san? – Mazyod Mar 07 '15 at 14:21
  • 1
    Open "Manage Schemes" and uncheck the appropriate things ;-) – cat Mar 08 '15 at 12:35
  • 1
    I faintly remember it was in Edit a Scheme and then Build and then Build and there is a column titled Archive with checkmarks. Which allows you to archive multiple targets into one. This design reminds me of Microsoft. – cat Mar 08 '15 at 12:41
  • 1
    Thanks, I suspected as much, but wasn't enough to resolve my issue, it seems. I was trying to build facebook's `AsyncDisplayKit`, instead I switched to cocoapods. – Mazyod Mar 08 '15 at 13:04
4

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

Kalpesh Panchasara
  • 1,730
  • 2
  • 15
  • 27
4

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.

G.Swift
  • 51
  • 3
3

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.

helloWorld
  • 229
  • 3
  • 7
3

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.

user9527
  • 315
  • 2
  • 11
3

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
Jules
  • 7,568
  • 14
  • 102
  • 186
3

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.

possen
  • 8,596
  • 2
  • 39
  • 48
2

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.

mkko
  • 4,262
  • 3
  • 25
  • 29
2

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.

bluebinary
  • 1,026
  • 14
  • 17
2

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.

KRS1
  • 19
  • 3
2

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

Sadanand
  • 1,080
  • 3
  • 13
  • 30
1

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

daksh_019
  • 802
  • 7
  • 16
  • added this answer for including this in the checklist given above. Its a real pain to solve such issues in Xcode. – daksh_019 Apr 23 '15 at 07:45
1

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

alparsons
  • 187
  • 6
1

This helped for me (2018 year)

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

check shared

Nike Kov
  • 12,630
  • 8
  • 75
  • 122
1

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!

sebastienhamel
  • 313
  • 2
  • 10
1

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

acecilia
  • 908
  • 8
  • 12
1

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

Vinay Podili
  • 335
  • 1
  • 3
  • 16
1

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.

Aswath
  • 1,236
  • 1
  • 14
  • 28
1

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
Drew Reese
  • 165,259
  • 14
  • 153
  • 181
1

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.

Kirill Kuzyk
  • 99
  • 1
  • 7
1

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.

Guilherme Muniz
  • 1,265
  • 11
  • 12
1

I had the same problem in my tvOS app.

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

Screenshot

zuziaaax
  • 11
  • 1
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.

udi
  • 3,672
  • 2
  • 12
  • 33
jadebowl
  • 11
  • 4
-1

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

Josep Alsina
  • 2,762
  • 1
  • 16
  • 12