存储工具包 2 错误 - 错误域=ASDErrorDomain 代码=509 "No active account"

Store Kit 2 Error - Error Domain=ASDErrorDomain Code=509 "No active account"

我正在尝试实施 StoreKit2 API 以实施 IAP,但不断收到错误 Error Domain=ASDErrorDomain Code=509 "No active account"

我在网上进行了研究,但找不到关于不同 ASDErrorDomain 错误代码的任何信息。有谁知道这个错误是什么意思?

如果你很好奇,下面是我的完整错误日志。

2022-05-31 02:33:35.491370-0500 (app name deleted for privacy) [Default] Error enumerating unfinished transactions for first transaction listener: Error Domain=ASDErrorDomain Code=509 "No active account" UserInfo={NSLocalizedDescription=No active account}
2022-05-31 02:33:35.884686-0500 (app name deleted for privacy) [Default] [StoreKit] Failed to get products through appstored in simulator, will try using appstoreagent on host mac:
Error Domain=ASDErrorDomain Code=507 "Error decoding response" UserInfo={NSLocalizedDescription=Error decoding response, NSLocalizedFailureReason=Could not decode media products response}
2022-05-31 02:33:36.296678-0500 (app name deleted for privacy) [Default] Error enumerating monthlySubscription current transactions: Error Domain=ASDErrorDomain Code=509 "No active account" UserInfo={NSLocalizedDescription=No active account}
objc[16313]: Class _PathPoint is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore (0x126673338) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/TextInputUI.framework/TextInputUI (0x137570fe8). One of the two will be used. Which one is undefined.
objc[16313]: Class _PointQueue is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore (0x126673310) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/TextInputUI.framework/TextInputUI (0x137571010). One of the two will be used. Which one is undefined.

我自己进行了一些谷歌搜索,并没有找到太多,但是 运行 到这个 link https://developer.apple.com/forums/thread/660287 这告诉我你的设备没有连接到 Apple Store 因此无法继续StoreKit 的使用。转到设置并点击配置文件图片所在的第一部分,然后使用有效的 appleid 登录。 希望对您有所帮助!