bizz84 / SwiftyStoreKit

Lightweight In App Purchases Swift framework for iOS 8.0+, tvOS 9.0+ and macOS 10.10+ ⛺
MIT License
6.57k stars 796 forks source link

Verify receipt Failed: networkError #604

Open pethanihiten opened 3 years ago

pethanihiten commented 3 years ago

Question

Hi Team,

Whan we verify receipt getting this error. please check

Screenshot 2020-12-18 at 3 49 00 PM

Verify receipt Failed: networkError(error: Error Domain=NSCocoaErrorDomain Code=512 "The file “_MASReceipt” couldn’t be saved in the folder “Contents”." UserInfo={NSFileOriginalItemLocationKey=file:///Volumes/BackUp/xcodeTempFiles/SwiftyStoreKit-macOS-Demo-ddjkbucnnomyyaevlkamrvvlljnw/Build/Products/Debug/SwiftyStoreKit-macOS-Demo.app/Contents/_MASReceipt, NSURL=file:///Volumes/BackUp/xcodeTempFiles/SwiftyStoreKit-macOS-Demo-ddjkbucnnomyyaevlkamrvvlljnw/Build/Products/Debug/SwiftyStoreKit-macOS-Demo.app/Contents/_MASReceipt, NSFileNewItemLocationKey=file:///System/Library/Caches/com.apple.receiptInstaller/SwiftyStoreKit-macOS-Demo.app/_MASReceipt/, NSUnderlyingError=0x600000ca0090 {Error Domain=NSCocoaErrorDomain Code=512 "The file “_MASReceipt” couldn’t be saved in the folder “SwiftyStoreKit-macOS-Demo.app”." UserInfo={NSURL=file:///System/Library/Caches/com.apple.receiptInstaller/SwiftyStoreKit-macOS-Demo.app/_MASReceipt/, NSFilePath=/System/Library/Caches/com.apple.receiptInstaller/SwiftyStoreKit-macOS-Demo.app/_MASReceipt, NSUnderlyingError=0x600000ca04b0 {Error Domain=NSPOSIXErrorDomain Code=18 "Cross-device link"}}}}) Purchase Failed: related decl 'e' for SKErrorCode(_nsError: Error Domain=SKErrorDomain Code=2 "(null)" UserInfo={NSUnderlyingError=0x600000c8e6d0 {Error Domain=com.apple.commerce.client Code=600 "(null)"}}) Purchase Failed: related decl 'e' for SKErrorCode(_nsError: Error Domain=SKErrorDomain Code=2 "(null)" UserInfo={NSUnderlyingError=0x600000c9f360 {Error Domain=com.apple.commerce.client Code=600 "(null)"}})

Thanks.

NikKovIos commented 3 years ago

It's your internal error.

RenGate commented 3 years ago

I don't use SwiftyStoreKit, but I experienced the same 512 error in Catalyst app while trying to refresh the receipt with SKReceiptRefreshRequest. I my case the DerivedData was located on a RAM disk and it looks like some Apple utility can't handle the case when the app being debugged is located on a non-system volume. Judging from the file path mentioned in your error it looks like your app binary is located on non-system volume as well. When I moved the DerivedData to its default location the error vanished.

dezinezync commented 1 year ago

@RenGate You got it spot on. This was indeed the issue and it immediately resolved after I configured my project to use a custom path (system-volume/Desktop).