Swift Package Manager gets stuck indefinitely upon adding new package [duplicate] - swift

After updating Xcode to version 13.2 i can't build my project anymore. I have a strange error "Internal error: missingPackageDescriptionModule" related to my Workspace file.
It's definitely related to SPM because Xcode is not loading SPM packages also. I tried to "Reset package caches", "Resolve package caches" and also "Updating to latest package caches" but after all of these operating nothing happens. Deleting derived data, cleaning didn't help too...
I tried also to resolve packages from Terminal using xcodebuild -resolvePackageDependencies but I get error message:
--- xcodebuild: WARNING: The directory /Users/ptocicki/Developer/KFC/kfc-ios also contains the legacy project 'project.pbxproj' - ignoring it and using 'KFC.xcodeproj'.
xcodebuild: error: Could not resolve package dependencies:
Internal error: missingPackageDescriptionModule"

Apple is aware of the issue.
We're currently investigating this issue — thank you to those who have
filed bug reports so far. To workaround this issue, please re-download
Xcode 13.2 directly from the Downloads page.
https://developer.apple.com/forums/thread/696504?answerId=698142022#698142022

🎊 Fixed on v13.2.1 and you can download from here
Explaination
This bug is reported and the v13.2.1 AppStore version but As  Apple suggest here, you should download the Xcode manually from the developer center
Manual download of any Apple developer software
✅ The always working and preferred workaround!
Download directly from Apple:
Latest Release version or
Latest Beta version or
Any version you need and all other downloadable contents
Then extract and move it where you like. This has so many benefits compared to AppStore updates. (like the ability to resume download, not replacing the old one, not wasting hidden directories and etc.)
Note that you should use safari to download it.
⚠️ Important note for developers like me!
The page you’re looking for can’t be found.
If you The page you’re looking for can’t be found message, you may need to use a VPN if you are in a country that the US sanctioned like mine. Because Apple is blocking some IP address ranges.

If you’re using Swift packages either standalone or as dependencies in an Xcode project or workspace, the Mac App Store version of Xcode fails during package resolution with the error “Internal error: missingPackageDescriptionModule.” (86435800)
Workaround: Download Xcode 13.2 directly from the Apple Developer website.

I just got the issues late at night after Xcode updated on its own while I was working on my project, which was not a cool surprise. It appears to be affecting all dependencies. You are not alone in this it's affecting everyone. I did what they recommended and downloaded Xcode directly from the Apples developer site and it fixed all my issues super happy right now!!!!!!!

XCode was updated to 13.2.1 at 12/19 which fix the issue.

https://developer.apple.com/documentation/xcode-release-notes/xcode-13_2-release-notes
If you’re using Swift packages either standalone or as dependencies in an Xcode project or workspace, the Mac App Store version of Xcode fails during package resolution with the error “Internal error: missingPackageDescriptionModule.” (86435800)
Workaround: Download Xcode 13.2 directly from the Apple Developer website.
Seems local package still working. So there is a temporary solution: We can download the dependencies then add them to the project as local paclages.

Please update to Xcode 13.2.1.
If not, download Xcode 13.2 from the Apple Developer website.

Updating from Xcode 13.2 to 13.2.1 from App Store fixed the issue for me.

Related

XCode - ITMS-90426: Invalid Swift Support

I receive the following mail after the upload of my app form xCode to the Apple Connect platform.
Dear Developer,
We identified one or more issues with a recent delivery for your app, <APPNAME> 0.23.0 (10). Please correct the following issues, then upload again.
ITMS-90426: Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it.
Best regards,
The App Store Team
Before uploading, I correctly validate the version, and xcode gives me the validation.
Do someone know how resolve this issue?
I have tried to follow some other Stakoverflow answers:
Go to Targets > YourApp > Build Settings
Defines Module: No
Always Embed Swift Standard Libraries: Yes
With no results
I'm running MacOS Ventura 13.1 and Xcode 14.2

Xcode 13.2 - Adding package hangs on "Preparing to validate"

I have recently updated to Xcode 13.2 from the Mac App Store. While trying to fix an issue with a Swift package, I uninstalled it and now I cannot reinstall the package.
When I try to add a package from GitHub the process hangs immediately on "Preparing to validate".
I already attempted to restart Xcode, restart my mac, clean derived data, reset Swift package caches and update package versions to no avail.
Is there any way around this issue?
Check https://developer.apple.com/forums/thread/696504 and re-download Xcode 13.2 directly from the releases section of the Apple Developer website: https://developer.apple.com/download/release/
Make sure to update Xcode to 13.2.1
They have just released the update that should fix it. See in the link that #mikeyh posted in the other answer: https://developer.apple.com/forums/thread/696504.
I'm on Xcode 13.4.1 and ran into this same problem when trying to convert my project from CocoaPods to SPM packages because I was using the Legacy Build Location setting. When trying to install any package it would immediately hang on "Preparing to validate..." just like in the screenshot of the question.
I did get an error stating something like the package could not be added because of using the Legacy Build Location setting, however I did not notice this in the Issue Navigator for a while because once I removed all of my CocoaPods and before I could add the SPM packages I was getting hundreds of build errors.
To fix (if your project can use the default Build Location setting) is to set it by going to
File->Project Settings...->Advanced...->Xcode Default

Unable to open Xcode 10.1. Getting Package Authoring Error

There are two Xcode 10.1 and 11 installed on my Mac wherein 10.1 is default one. I was able to open project using Xcode 10.1 until few hours ago. However, after restarting my mac I'm facing strange issue as described below:
Package Authoring Error: PackageInfo bundle reference found without top-level bundle definition. Bundle will be skipped.
Check attached screenshot for additional details.
Below are solutions that I tried:
Tried mutiple time to open project using Xcode10.1 but still the same issue
Restart Mac.
Take a note that I cannot move my project into Xcode11 there are certain dependicies due to which I've to use Xcode10.1.
Apple is enforcing developer to use latest version of Xcode.
There are two solution for this:
Move on to Xcode 11 (recommended)
Delete Xcode 10.1 and freshly install Xcode 10.1
I would suggest to go with solution 1.
I have read somewhere answer but I am not able to get that link here,
but I know that you can try, change the system date to 3rd October 2019 and try again so it will work.
This is not my answer so all credit goes to unknown developer.

Xcode SDK Version Issue

I'm having a bit of an issue with distributing an app via the latest version of Xcode (Version 10.1 (10B61)). Every time I try to upload it to the App Store via organizer, I get this error after uploading:
WARNING ITMS-90725: "SDK Version Issue. This app was built with the iOS 12.0 SDK. Starting March 2019, all iOS apps submitted to the App Store must be built with the iOS 12.1 SDK or later, included in Xcode 10.1 or later."
Previous answers to this question said that it was just a warning and that I should still be able to upload my app, but it is now March and I am still getting the error even on 10.1. iTunesConnect will not let me select these builds and I get emails about the validation failure.
Further details:
-The app is an iMessage extension, and uses exactly 1 framework from Carthage, which is up to date with the latest framework version and Carthage version.
-My project and Message extension targets Swift Language Version build setting is Swift 4.2.
-My deployment target is iOS 11.0, but the issue persists after selecting iOS 12.1.
-The app compiles and runs fine on my physical device running iOS 12.1.
-The issue persists after a build folder clean.
-The issue persists after reinstalling Xcode.
If anyone has any suggestions as to how I can verify my app is compiling with the latest SDK please let me know.
Whether the app runs on given iOS version, has no relevance to which SDK are you really using. The definitive SDK version used for building is found in the app's Info.plist.
after Archiving, Show the xcarchive in Finder.
right-click, Show Package Contents.
open Products/Applications/YourApp.app
right-click, Show Package Contents.
copy the Info.plist to some place where you can run terminal commands on it
/usr/libexec/PlistBuddy -c "print :DTSDKBuild" Info.plist
You would expect it to show "16B91" for SDK 12.1. If it's something else (SDK 12.0 would be "16A366"), here are some ideas:
inspect the Carthage dependency. Are you really building it locally or downloading a prebuilt binary? If in doubt, force local building with --no-use-binaries. Remove whole Carthage folder (Checkouts as well as Build) and start from scratch.
rm -rf ~/Library/Developer/Xcode/DerivedData instead of just "build folder clean"
Verify MacOS System Report section Software/Developer for the actual SDK versions that MacOS thinks that you have
xcode-select -p to verify that you are really using the Xcode instance that you would like to
If all looks correct on your side, fill Technical Support Incident. Report the exact rejected build which you uploaded already. That should speed up the support reaction.
I filled out a bug report with Apple because I was experiencing the exact same issue and none of the above solutions worked. They made a change on their backend and now everything is back to proper working order.
If you haven't tried in awhile, make another attempt and I'm betting that it'll work this time.
I was having the same problem. My app was compiled in Xcode 10.1 but I was still getting the SDK warning. I was able to resolve it by doing the following. I'm not sure if all these steps are necessary. I didn't try validating between steps.
I upgraded macOS to Mojave (10.14.3). I had been running High Sierra.
Delete Xcode from applications folder
Reinstall Xcode from the app store
Open my project and run Project->Clean Build folder
Archive and upload and no more warnings

Xcode warning: application executable contains unsupported architecture(s):arm, arm (-19031)

I've been receiving this warning since I loaded my project in last Xcode 4 preview. There was no warning before that but now I can't get rid of it even in Xcode 3.2. I've been googling but nobody seems to have the same error.
My project and target settings are correct (IMHO): Architectures: Standard (armv6 armv7), Base SDK: Latest iOS (currently set to iOS 4.2), Build Active Architecture Only: FALSE, Valid Architectures: armv6 armv7.
I compared every project setting with other projects and and found no differences. I even have recreated the project starting from scratch and copying classes, resources and frameworks with the same result.
I must say that the warning is not shown when I set Debug configuration.
I hope someone can help me because I don't know what to do. Thanks in advice.
I kept getting this error and it was driving me crazy. Then I realized I was building the project for Simulator instead of Device. Once I made the change, I was able to upload the app without a problem.
Several things spring to mind. Firstly that there is some file lurking around in the build directory. But I presume you have deleted the build directory. Secondly, that there is something lurking in your library directories. I think xcode puts some tempt files down in them now. Thirdly that something has gone funny is the core xcode setup.
So here's what I would try (the emphasis here is "try" - I don't know if any of this will work :-)
Make sure you have deleted the build directory.
Do a full un-installation of code. Clear out any developer directories and then re-install.
SOLVED!. Not a good solution though.
After a thousand tests I uninstalled Xcode 3.2.5 and installed 3.2.4. Everything went ok since then. Now I'm afraid of upgrade to last version again. :/