evgenyneu / keychain-swift

Helper functions for saving text in Keychain securely for iOS, OS X, tvOS and watchOS.
MIT License
2.85k stars 345 forks source link

Error installing Swift Package #147

Open hiropome opened 3 years ago

hiropome commented 3 years ago

Hi, thanks for sharing this package. I tried to install via Swift Package but got the error below stating "keychain swift could not be resolved" Could you kindly help me out?

スクリーンショット 2021-11-05 11 35 46
ChrisMarshallNY commented 3 years ago

I think that this may be due to Xcode now insisting on using HTTPS for everything.

I use the SSH version of the URI, and it works for me: git@github.com:evgenyneu/keychain-swift.git

gklka commented 2 years ago

Same error for me. The error message is not visible on the image, here it is:

the manifest is missing a Swift tools version specification; consider prepending to the manifest '// swift-tools-version:5.5.0' to specify the current Swift toolch...

(the rest is emitted)

Does not matter if I use the https or the git URL version.

evgenyneu commented 2 years ago

Fixed this in the new version: https://github.com/evgenyneu/keychain-swift/blob/master/Package.swift

Hustenbonbon commented 2 years ago

Hi & thanks! Can you create a release tag for that?

evgenyneu commented 2 years ago

Already done, it's in version 20.0.0

Hustenbonbon commented 2 years ago

Thanks for the quick response! Weird, when adding over XCode version 9 is proposed as default. It looks like SPM is sorting the major versions alphanumeric (which sounds to strange as that I want to believe it). My personal problem is resolved though, so thanks for the quick response and the awesome helper tool!

image
Throvn commented 2 years ago

Thanks, I had the exact same problem!

So in a nutshell, XCode is a baddie and shows an old version as default. To resolve this, just change the dependency rule to branch: master. In case someone else is new to swift ;)

ChrisMarshallNY commented 2 years ago

I don't like using master for my dependencies. I'll stick with pinned releases. I use master when debugging my own modules, or for demo test harnesses, but for releases to be included in other places (like the App Store, or as a published SPM module), I use semantic versioned releases.

My pattern is that I have Major.Minor.Fix.

Major is for breaking API changes, or major features.

Minor is for API changes that won't break things, but are worth testing. There may be some app UI changes, such as rearranged screens, and whatnot.

Fix is for bug fixes. It may include very minor API changes or app changes, if the changes fix a bug.