Closed weizenberg closed 5 years ago
@weizenberg Thanks for reporting, I will upload a fix on cocoapods in a bit.
@weizenberg while it's being publishing you can try the last version
pod 'TPInAppReceipt', :git => 'https://github.com/tikhop/TPInAppReceipt.git', :branch => :master
Version 2.1.0 has been released. It should contain a fix.
Hello @tikhop , thank you for your hard work!
We're at the latest version (2.1.2) and we get random crashes at
let receipt = try InAppReceipt.localReceipt()
. No specific device/OS version (no iOS13). We couldn't reproduce them yet. We're symbolicating crashes and will get you missing symbols ASAP. In the meantime, can you make anything from this log?
0 libsystem_kernel.dylib 0x2192d20dc __pthread_kill + 8
1 libsystem_pthread.dylib 0x21934b094 pthread_kill$VARIANT$mp + 380
2 libsystem_c.dylib 0x21922bea8 abort + 140
3 libswiftCore.dylib 0x2472b82a8 swift_vasprintf(char**, char const*, char*) + 54
4 libswiftCore.dylib 0x2472b09b4 swift::swift_dynamicCastFailure(swift::TargetMetadata<swift::InProcess> const*, swift::TargetMetadata<swift::InProcess> const*, char const*) + 74
5 libswiftCore.dylib 0x2472b0a2c swift::_conformsToProtocol(swift::OpaqueValue const*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolDescriptorRef<swift::InProcess>, swift::TargetWitnessTable<swift::InProcess> const**) + 118
6 libswiftCore.dylib 0x2472b25b8 swift_dynamicCastImpl(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetMetadata<swift::InProcess> const*, swift::DynamicCastFlags) + 3628
7 libswiftCore.dylib 0x2472b36ac _dynamicCastFromExistential(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetExistentialTypeMetadata<swift::InProcess> const*, swift::TargetMetadata<swift::InProcess> const*, swift::DynamicCastFlags) + 312
8 TPInAppReceipt 0x103f47cc8 (Missing)
9 TPInAppReceipt 0x103f3814c (Missing)
10 TPInAppReceipt 0x103f4859c (Missing)
11 TPInAppReceipt 0x103f48eac (Missing)
UPDATE: Here's the symbolicated crash log
0 TPInAppReceipt 0x1022e0104 closure #1 in InAppReceiptPayload.init(asn1Data:) + 95 (InAppReceiptPayload.swift:95)
1 TPInAppReceipt 0x1022d014c specialized ASN1Object.enumerateInAppReceiptAttributes(with:) + 53 (<compiler-generated>:53)
2 TPInAppReceipt 0x1022e059c specialized InAppReceiptPayload.init(asn1Data:) + 112 (InAppReceiptPayload.swift:112)
3 TPInAppReceipt 0x1022e0eac static InAppReceipt.localReceipt() + 56 (InAppReceipt.swift:56)
Could not cast value of type 'TPInAppReceipt.ASN1Object' (0x10581ca78) to 'Foundation.Data' (0x1f1e90d90).
Hello @b-onc, thanks for posting an issue. I'll take a look in a bit. Meanwhile, is there a chance that you can provide your receipt in order to debug it?
@b-onc I've push some fix which may solve your issue. Can you try to instal pod from master
branch:
pod 'TPInAppReceipt', :git => 'https://github.com/tikhop/TPInAppReceipt.git', :branch => :master
Thank you.
Thank you for the quick response, @tikhop . We're trying the master branch and will get back to you as soon as we have more info. We'll try to provide receipt data too.
@b-onc Sounds good. Thank you!
Hello @tikhop !
We are trying to write a unit test to check if some of the receipts we have are being correctly parsed by the pod. The base64encoded receipt I'll add below crashes at InAppReceiptPayload:76
with error Unexpectedly found nil
, the type
property of InAppReceiptAttribute
is nil
. This is not the crash we're seeing in the wild, although I don't know why it happens. Can you please check?
Thank you!
deleted
@b-onc pushed a fix
@b-onc I've released a new version and been using it for some time for my current project — seems to be working well.
Does the last fix work for you?
Hello @tikhop ,
I'm testing the latest version you've pushed, and it's crashing for the receipts I'll attach below. InAppReceiptPayload:93
, Could not cast value of type 'TPInAppReceipt.ASN1Object' (0x10dcb2038) to 'Foundation.Data' (0x1128d34f8).
Receipts: Can you send me an email at bahadir.oencel@fretello.com so I can share more receipts?
Hello @b-onc,
Thanks for providing more receipts. I was able to reproduce the issue and It has been fixed in the last commit and release.
I have checked all your receipts and mine too — works well.
Thanks again.
Hello @tikhop All 2309 receipts we have parse correctly with the latest release (2.1.2) This can be closed now.
Thank you for all the help!
@b-onc Awesome! Thanks for collaborating, helped a lot.
Hello, The lib crashing at the 2.0.6 version for some users. Attaching the crash log: