简体   繁体   中英

xcode is creating generic xcode archive instead of iOS App Archive

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.

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

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

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.

我的情况是我在项目中有 2 个目标,一旦我将其中一个目标设置为 Skip Install =“YES”,问题就解决了

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!

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

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

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 eg git!

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

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.

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.

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.

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

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.

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.

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.

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

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

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.在此处输入图像描述

我的问题是在安装 pod 后开始的,在更新 cocoapods(从 0.38 到 0.39)并再次运行 pod install 后问题就消失了。

This helped for me (2018 year)

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

检查共享

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.

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!

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

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

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.

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

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.

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.

I had the same problem in my tvOS app.

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

Screenshot

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.

确保在 Project Settings > General 下设置了 Build 字段。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM