BLACK FRIDAY SALE: Save big on all my Swift books and bundles! >>

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.

1      

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

1      

Download the file, add by yourself.

1      

Hacking with Swift is sponsored by RevenueCat

SPONSORED In-app subscriptions are a pain to implement, hard to test, and full of edge cases. RevenueCat makes it straightforward and reliable so you can get back to building your app. Oh, and it's free if your app makes less than $10k/mo.

Learn more

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.