应用程序仅在审核阶段在 AppStore 审核者的设备上崩溃。无法复制崩溃,我的 TestFighters 也无法复制。用atos诊断

问题描述 投票:0回答:0

因此,我现在一直在与 Apple 审阅者反复讨论,试图解决他们在我的应用程序中成功进行 IAP 后遇到的崩溃问题。我自己无法复制它,因为所有购买,无论是否成功,对我以及我所有通过 TestFlight 测试过此应用程序的朋友来说都是如此。

仅当评论者购买商品并出现成功购买警报时,才会发生崩溃。一旦他们点击“确定”,它就会崩溃。它出现时可能会崩溃,但根据本文后面的崩溃日志的堆栈跟踪,它似乎更可能在关闭时崩溃。

作为参考,我仅使用普通 StoreKit 和 SwiftyStoreKit 来处理尝试解决此问题的购买,因为我认为在尝试普通 StoreKit 后我在某个地方搞砸了,但它们仍然有相同的崩溃。

审阅者给了我崩溃日志,我刚刚开始学习如何使用 atos 工具来了解出了什么问题。 ChatGPT 告诉我堆栈跟踪中的这部分:

{"value":4335622920,"matchesCrashFrame":1}
是它崩溃的地方。

然后我获取该内存地址并运行 atos 命令:

atos -o "/Users/me/Library/Developer/Xcode/Archives/2023-07-31/myapp 7-31-23, 4.42 PM.xcarchive/dSYMs/myapp.app.dSYM/Contents/Resources/DWARF/myapp" -arch arm64 -l 4335288320 4335622920 

得到结果:

_OBJC_CLASS_RO_$_PodsDummy_GoogleAppMeasurementIdentitySupport (in myapp) + 93752

我使用 Cocoapods 安装了所有附加库,即 FirebaseAuth、FirebaseFirestore、IQKeyboardManager、FirebaseFirestoreSwift、Google-Mobile-Ads-SDK 和 SwiftyStorekit,因此这让我相信我的项目中存在冲突的 pod,即使我或其他人也如此已经测试过这一点曾经能够复制。然后我尝试从我的 podfile 中删除

pod 'FirebaseAnalytics'
行(我认为只有一行与此相关),然后 xcode 在尝试构建时向我抛出错误:

File not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a

这对我来说毫无意义。我也在模拟器和物理设备上尝试过。我一直在尝试使用以下命令在堆栈跟踪顶部标记 ChatGPT 标记为潜在问题的更多内容:

atos -o "/Users/jack/Library/Developer/Xcode/Archives/2023-07-31/SatStacker 7-31-23, 4.42 PM.xcarchive/dSYMs/SatStacker.app.dSYM/Contents/Resources/DWARF/SatStacker" -arch arm64 -l 4335288320 8925373064

atos -o "/Users/jack/Library/Developer/Xcode/Archives/2023-07-31/SatStacker 7-31-23, 4.42 PM.xcarchive/dSYMs/SatStacker.app.dSYM/Contents/Resources/DWARF/SatStacker" -arch arm64 -l 4335288320 6131576953

但那些只是回显相同的地址,从我读到的内容来看,这意味着它超出了我的应用程序内存范围,所以我看不到它是什么。我已经三次检查崩溃日志中应用程序的 UUID 是否与我使用以下命令生成的 dSYM UUID 相匹配:

dwarfdump --uuid "/Users/jack/Library/Developer/Xcode/Archives/2023-07-31/SatStacker 7-31-23, 4.42 PM.xcarchive/dSYMs/SatStacker.app.dSYM/Contents/Resources/DWARF/SatStacker"

作为参考,我调用来启动购买的函数将来自 AppStoreConnect 的捆绑 ID 作为参数,如下所示:

func buyInAppPurchase(productID: String) {
        DispatchQueue.main.async {
            self.delegate?.showSpinner()
        }
        
        SwiftyStoreKit.purchaseProduct(productID, quantity: 1, atomically: true) { result in
            switch result {
            case .success(let purchase):
                print("Purchase Success: \(purchase.productId)")
                self.validateReceipt { isValid in
                    if isValid {
                        self.delegate?.sendInfo(itemNum: self.itemNumber)
                    } else {
                        print("Receipt validation failed after purchase.")
                    }
                    self.itemNumber = 0  // Reset itemNumber here after handling the purchase
                    DispatchQueue.main.async {
                        self.delegate?.hideSpinner()
                    }
                }
            case .error(let error):
                print("Purchase failed: \(error)")
                self.itemNumber = 0  // Reset itemNumber here after handling the error
                DispatchQueue.main.async {
                    self.delegate?.hideSpinner()
                }
            }
        }
    }

再次,我自己无法复制崩溃,我正在尝试学习如何阅读此崩溃日志,但其中很多内容看起来真的很奇怪/奇怪,因为它看起来应该工作得很好。

这里还有更多堆栈跟踪供参考:

"threads" : [{"triggered":true,"id":3878218,"threadState":{"x":[{"value":1},{"value":1},{"value":8925373064,"symbolLocation":0,"symbol":"type metadata for Date"},{"value":6131576953},{"value":0},{"value":2976},{"value":1},{"value":3},{"value":0},{"value":0},{"value":10746840608},{"value":2684878849},{"value":845},{"value":4822103232},{"value":2043},{"value":8901477912,"symbolLocation":0,"symbol":"OBJC_CLASS_$_NSObject"},{"value":9056690256,"symbolLocation":0,"symbol":"_platform_memmove"},{"value":8925321232},{"value":0},{"value":4862313952},{"value":0},{"value":8925373064,"symbolLocation":0,"symbol":"type metadata for Date"},{"value":10788848736},{"value":6131576944},{"value":0},{"value":0},{"value":4862314128},{"value":8925303232,"symbolLocation":0,"symbol":"value witness table for Builtin.Int64"},{"value":8850628608,"symbolLocation":0,"symbol":"OBJC_IVAR_$_UIPopoverController._originalArrowDirections"}],"flavor":"ARM_THREAD_STATE64","lr":{"value":4335621548},"cpsr":{"value":1610616832},"fp":{"value":6131577408},"sp":{"value":6131576928},"esr":{"value":4060086273,"description":"(Breakpoint) brk 1"},"pc":{"value":4335622920,"matchesCrashFrame":1},"far":{"value":10212828596}},"queue":"com.apple.main-thread","frames":[{"imageOffset":334600,"imageIndex":0},{"imageOffset":258640,"imageIndex":0},{"imageOffset":226548,"imageIndex":0},{"imageOffset":54412,"symbol":"-[UIViewController _setViewAppearState:isAnimating:]","symbolLocation":1236,"imageIndex":23},{"imageOffset":4576128,"symbol":"-[UIViewController __viewWillDisappear:]","symbolLocation":96,"imageIndex":23},{"imageOffset":7751708,"symbol":"__56-[UIPresentationController runTransitionForCurrentState]_block_invoke_3","symbolLocation":608,"imageIndex":23},{"imageOffset":3291668,"symbol":"+[UIPresentationController _scheduleTransition:]","symbolLocation":80,"imageIndex":23},{"imageOffset":3289360,"symbol":"-[UIPresentationController runTransitionForCurrentState]","symbolLocation":1564,"imageIndex":23},{"imageOffset":7746456,"symbol":"-[UIPresentationController _dismissWithAnimationController:interactionController:target:didFinish:]","symbolLocation":400,"imageIndex":23},{"imageOffset":3050576,"symbol":"-[UIViewController _dismissViewControllerWithAnimationController:interactionController:completion:]","symbolLocation":424,"imageIndex":23},{"imageOffset":3147016,"symbol":"-[UIViewController _dismissViewControllerWithTransition:from:completion:]","symbolLocation":1016,"imageIndex":23},{"imageOffset":3145672,"symbol":"-[UIViewController dismissViewControllerWithTransition:completion:]","symbolLocation":1856,"imageIndex":23},{"imageOffset":3143792,"symbol":"-[UIViewController _performCoordinatedPresentOrDismiss:animated:]","symbolLocation":396,"imageIndex":23},{"imageOffset":4083800,"symbol":"-[UIViewController dismissViewControllerAnimated:completion:]","symbolLocation":148,"imageIndex":23},{"imageOffset":15606216,"symbol":"__103-[UISheetPresentationController _startInteractiveTransitionWithProgress:fromViewController:completion:]_block_invoke","symbolLocation":92,"imageIndex":23},{"imageOffset":3408148,"symbol":"+[UIViewController _performWithoutDeferringTransitionsAllowingAnimation:actions:]","symbolLocation":140,"imageIndex":23},{"imageOffset":15606064,"symbol":"-[UISheetPresentationController _startInteractiveTransitionWithProgress:fromViewController:completion:]","symbolLocation":292,"imageIndex":23},{"imageOffset":1101580,"symbol":"-[UISheetPresentationController sheetInteraction:didChangeOffset:]","symbolLocation":1252,"imageIndex":23},{"imageOffset":1100268,"symbol":"-[_UISheetInteraction sendCurrentOffsetDidChange]","symbolLocation":100,"imageIndex":23},{"imageOffset":4033236,"symbol":"+[UIView(UIViewAnimationWithBlocksPrivate) _modifyAnimationsWithPreferredFrameRateRange:updateReason:animations:]","symbolLocation":168,"imageIndex":23},{"imageOffset":4033052,"symbol":"__86-[_UISheetInteraction draggingChangedInSource:withTranslation:velocity:animateChange:]_block_invoke_2","symbolLocation":152,"imageIndex":23},{"imageOffset":2446820,"symbol":"-[UIViewPropertyAnimator _runAnimations]","symbolLocation":180,"imageIndex":23},{"imageOffset":6100836,"symbol":"__49-[UIViewPropertyAnimator startAnimationAsPaused:]_block_invoke_3","symbolLocation":68,"imageIndex":23},{"imageOffset":2914764,"symbol":"__49-[UIViewPropertyAnimator startAnimationAsPaused:]_block_invoke","symbolLocation":92,"imageIndex":23},{"imageOffset":2445952,"symbol":"__49-[UIViewPropertyAnimator startAnimationAsPaused:]_block_invoke_2","symbolLocation":224,"imageIndex":23},{"imageOffset":2451676,"symbol":"-[UIViewPropertyAnimator _setupAnimationTracking:]","symbolLocation":100,"imageIndex":23},{"imageOffset":2450728,"symbol":"-[UIViewPropertyAnimator startAnimationAsPaused:]","symbolLocation":784,"imageIndex":23},{"imageOffset":4491476,"symbol":"__86-[_UISheetInteraction draggingChangedInSource:withTranslation:velocity:animateChange:]_block_invoke","symbolLocation":196,"imageIndex":23},{"imageOffset":1985380,"symbol":"-[_UIHyperInteractor _interactionChangedMutatingTranslation:velocity:mutatingState:]","symbolLocation":152,"imageIndex":23},{"imageOffset":1983820,"symbol":"-[_UIHyperInteractor _interactionChangedCopyingTranslation:velocity:mutatingState:]","symbolLocation":156,"imageIndex":23},

有人知道遇到这种情况该怎么办吗?我真的很茫然,不知道是什么原因导致了这次崩溃。

swift xcode in-app-purchase app-store google-analytics-firebase
© www.soinside.com 2019 - 2024. All rights reserved.