UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Project 16 / Xcode / problem adding Swift Package

Forums > 100 Days of SwiftUI

In Xcode 13 beta 1, they've moved how you access 3rd party Swift Packages: File menu -> Add Packages...

However, when I attempt to "+" to add a collection, and enter https://github.com/twostraws/CodeScanner into the dialog box, I get the following error:

The operation couldn't be completed. (PackageCollections.JSONPackageCollectionProviderError error 3.)

OK, so I downloaded the git repository, and attempted to "Add Local..." - but after I select the folder containing the package I am returned to the Project -> Swift Packages tab with NO new packages added.

I'm guessing this is a Xcode beta 1 issue - but it does appear as if the tutorial will need to be updated to reflect Apple's new way of accessing Packages.

3      

I have added it with no problem

  1. File Menu > Add Packages…
  2. Then in the "Search or Enter Package URL" add https://github.com/twostraws/CodeScanner
  3. Then Add Package
  4. Then click the package product and Add Package

Its a good idea to do a Build (cmd+B) then should be able to import CodeScanner and then use it.

Did this on Xcode 13 beta 1

3      

Download the file, add by yourself.

3      

BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.

Get it on Hacking with Swift+

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.