macOS – 上天在惩罚我。无论我怎么做,这个应用的收据加载都失败得很惨。

huangapple go评论137阅读模式
英文:

macOS - The Gods are punishing me. The app's receipt fails miserably to load, no matter what I do

问题

我在Stack Overflow上测试了所有类似问题的解决方案,但它们都对我无效。

我认为我的情况不同,因为应用程序的收据甚至没有加载。

我至少已经开发了这个macOS应用程序7个月。该应用包含自动续订订阅。

从第一天开始,我成功地检索和验证了收据。一切都没有问题。那些都是美好的日子。

2020年1月3日,我再次开始开发这个应用程序。

从那时起,该应用程序甚至无法加载收据。代码没有任何更改,什么都没有变化。

即使是像这样的简单代码,从Apple复制而来,也失败了。

// 获取收据(如果可用)
if let appStoreReceiptURL = Bundle.main.appStoreReceiptURL,
    FileManager.default.fileExists(atPath: appStoreReceiptURL.path) {

    do {
        let receiptData = try Data(contentsOf: appStoreReceiptURL, options: .alwaysMapped)
        print(receiptData)

        let receiptString = receiptData.base64EncodedString(options: [])

        // 读取 receiptData
    }
    catch { print("无法读取收据数据,错误: " + error.localizedDescription) }
} else {      
  exit(173)
  print("这个错误很糟糕!")
}

这一行

FileManager.default.fileExists(atPath: appStoreReceiptURL.path)

彻底失败了。收据不存在。

到目前为止,我尝试过以下方法:

  1. 哭泣
  2. 重新启动计算机
  3. 删除 ~/Library/Caches/com.apple.appstore
  4. 创建一个新的沙盒用户
  5. 尝试使用几年前创建的旧沙盒用户。
  6. 重新安装Xcode
  7. 退出App Store和iCloud + 再次重启计算机。
  8. 结束storeaccountd守护程序 + 重启。
  9. 确认Info.plist中的版本和BundleID与appstoreConnect中的相同。

我得到的一切都是

网络错误(error: Error Domain=SKErrorDomain Code=0 "(null)")

触发了 exit(173),我输入沙盒用户,然后我得到

应用已损坏,无法打开。请从App Store中删除该应用并重新下载。

我在10年前开发的iOS设备应用程序上也遇到了这个问题,唯一解决方法是将设备恢复到出厂设置。老实说,我不想重新安装macOS。

我绝望了。在过去的几天里,我已经老了20年。

是否有一些可能被堵塞的缓存或macOS服务?

我注意到一件事,即输入App Store凭据的弹出框不显示单词 sandbox,而是在尝试购买应用内购时弹出的框,而且这些框总是预填充了一个旧的沙盒用户。有没有清理的方法?

还有其他的想法吗?

英文:

I have tested all solutions on similar questions on SO and they all failed for me.

I think mine is different because the application's receipt is not even loading.

I am having developing this macOS app for at least 7 months. The app contains Auto-Renewable Subscription.

Since day one, I am retrieving and validating its receipt with success. No problem at all. That were the good days.

January 3, 2020, I started working on the app again.

Since then, the app fails miserably to even load the receipt. No change in code, nothing.

Even a simple code like this, that is copied from Apple, fails.

// Get the receipt if it's available
if let appStoreReceiptURL = Bundle.main.appStoreReceiptURL,
    FileManager.default.fileExists(atPath: appStoreReceiptURL.path) {

    do {
        let receiptData = try Data(contentsOf: appStoreReceiptURL, options: .alwaysMapped)
        print(receiptData)

        let receiptString = receiptData.base64EncodedString(options: [])

        // Read receiptData
    }
    catch { print("Couldn't read receipt data with error: " + error.localizedDescription) }
} else {      
  exit(173)
  print("this error stinks!")
}

this line

FileManager.default.fileExists(atPath: appStoreReceiptURL.path)

fails miserably. The receipt is not there.

This is what I have tried so far:

  1. cry
  2. restart the computer
  3. delete ~/Library/Caches/com.apple.appstore
  4. create a new sandbox user
  5. try with an old sandbox user created years ago.
  6. reinstall Xcode
  7. log out of App Store and iCloud + restart the computer again.
  8. killed the storeaccountd daemon + restart.
  9. confirmed that the version and the bundleID on Info.plist are the same as in appstoreConnect.

Everything I get is

> networkError(error: Error Domain=SKErrorDomain Code=0 "(null)")

exit(173) is triggered, I type the sandbox user then I get

> The app is damaged and can’t be opened. Delete the app and download it again from the App Store.

I have had this problem on an iOS device application I was developing 10 years ago and the only way I have managed to solve that was by resetting the device to factory default. Sincerely, I will not reinstall macOS.

I am desperate. I have aged 20 years in the last couple of days.

Is there some cache or macOS service that might be clogged?

One thing I have noticed is that the box the pops to type the App Store credentials do not show the words sandbox as the boxes the pop when you try to buy the in-app purchase and that this boxes always comes pre-filled with an old sandbox user. Is there a way to clean that?

Any other ideas?

答案1

得分: 1

我已经向苹果开了一个技术故障报告,但他们无法解决这个问题。

有人建议我唯一解决问题的方法是在同一台 Mac 上创建另一个用户并从那里进行测试。

问题已解决

如果您在 iOS 上遇到此问题,解决方法是将设备恢复到出厂默认设置。


注意:显然,这次整个问题是由于苹果发布了一次半成品更新导致的,影响了他们的沙盒/生产服务器。

英文:

I have opened a technical incident with Apple and they were unable to solve that.

Someone suggested me the only thing that solved the problem: to create another user on the same Mac and test it from there.

PROBLEM SOLVED

If you are having this problem from iOS, the solution is to reset the device to factory defaults.


Note: apparently, this time, the whole problem was caused by Apple, after a half cooked update to their sandbox/production servers.

huangapple
  • 本文由 发表于 2020年1月6日 23:41:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/59614963.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定