Comments (6)
Seems sounds like a duplicate of #10 (see the Debugging section of the README), and possibly related to #33. Keychain is notoriously unreliable when running on device through Xcode. I strongly recommend making signed builds to test keychain. Am I right to assume you haven't seen this issue in a signed build?
When you hit this issue in debug, just cancel the run and hit Run once more. It'll likely work the second time (thanks, Xcode).
Closing this out for now. Happy to re-open if you need more help or if you uncover more information (or possible incompatibility issues).
from valet.
You're right, rerunning does make it go away.
Are all debug builds unsigned then? I've got my certificate and provisioning profile explicitly setup for debug builds too. I'm following Jared Sinclair's guide for setting them up, so you could say I'm being pretty pedantic here.
from valet.
My understanding is debug builds are either unsigned or signed differently – not using a provisioning profile, for example – than non-debug builds. I'm not an expert on signing, however (cc @justinseanmartin and @mtauraso who are).
Running debug builds on device from Xcode is a recipe for signing sadness. Keychain issues in debug builds are usually red herrings (unless you can repro them in a properly signed build). I have a NSAssert([loginValet canAccessKeychain])
at the beginning of applicationDidFinishLaunching:
, which alerts me that Xcode screwed up quite quickly.
from valet.
All builds that are built for iOS devices need to be code signed, but they can be signed for development, enterprise distribution, or app store distribution. I believe you should be able to sign Debug builds with any of the above identities, but it is standard to sign Debug builds with your developer identity and sign Release builds with the app store identity.
I wouldn't expect that it is code signing that is causing problems, but more likely an issue with how xcode installs developer apps or the black magic of how Xcode is picking a certificate/provisioning profile/code signing identity/teamID is messing something up.
@dfed - Would it make sense to move the NSAssert with a helpful error message for canAccessKeychain into Valet initialization for debug builds on real devices with a helpful failure message?
from valet.
I don't believe that consumable projects should assert if it can be avoided. That's why we wrote the Debugging section in the README.
Moreover, different Valet configurations might be inaccessible under different configurations, so any NSAssert
we put into the code might not be looking at a helpful configuration.
from valet.
@dfed @justinseanmartin Thank you for the in-depth explanation. Happy I'm not the only one on the flaky code signing while developing boat.
Happy to report the issue did not reappear since the start of this thread.
Will use the NSAssert([loginValet canAccessKeychain])
assertion to aid in my development. Thanks for the protip.
from valet.
Related Issues (20)
- Add convenience access methods for `Codable` types HOT 6
- .whenUnlocked vs .afterFirstUnlock HOT 3
- Create new KeyChain Option HOT 5
- SecKeychainAddCallback(_:_:_:) along with Valet HOT 4
- Enable customization of biometrics prompt with application-specific fallback HOT 26
- Unit tests fail on tvOS 14 HOT 4
- Tips on building and running the sample app? HOT 1
- Keychain Sharing between iOS App and Apple Watch Extension HOT 6
- Documentation for `afterFirstUnlockThisDeviceOnly` wrong? HOT 1
- iOS 15 crash on `specialized static SecItem.copy<A>(matching:)` HOT 18
- [Feature Request] Unlock with Apple Watch with no passcode fallback HOT 7
- iOS 16 build error HOT 6
- tvOS target doesn't compile with Xcode 14.0 beta HOT 8
- Deprecation warnings when targeting iOS 14+ HOT 4
- (Some folks) await async support HOT 5
- error: non-void function does not return a value [-Werror,-Wreturn-type] HOT 2
- No way to invalidate() HOT 1
- Support for cryptographic key item (kSecClassKey) HOT 2
- Could not find module 'Valet' for target 'x86_64-apple-ios-simulator' HOT 7
- Migration from Valet 3 format HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from valet.