Closed keesvandieren closed 5 years ago
I checked the code. The strong ref is added, and the IosFetchProductsAndInstallDelegate
is started later and makes sure the strong ref is only removed once. Strong ref operations are synchronized, so it's also unlikely that we have some kind of race condition here. I would suggest to catch the IllegalArgumentException around line 327 so that startupTransactionObserver is nulled afterwards and the app continues to launch - what do you think?
@MrStahlfelge submitted a PR for it, if you have some time to review, would be great :-)
Still got the crash:
Fatal Exception: java.lang.IllegalArgumentException
java.lang.IllegalArgumentException: No strong ref exists from <SKPaymentQueue: 0x2813373d0>
(a org.robovm.apple.storekit.SKPaymentQueue)
to <j_com_badlogic_gdx_pay_ios_apple_PurchaseManageriOSApple$PromotionTransactionObserver: 0x2813373b0>
a (com.badlogic.gdx.pay.ios.apple.PurchaseManageriOSApple$PromotionTransactionObserver)
at org.robovm.objc.ObjCObject$AssociatedObjectHelper.removeStrongRef(ObjCObject.java:689)
at org.robovm.objc.ObjCObject.removeStrongRef(ObjCObject.java:220)
at com.badlogic.gdx.pay.ios.apple.PurchaseManageriOSApple$IosFetchProductsAndInstallDelegate.didReceiveResponse(PurchaseManageriOSApple.java:332)
at com.badlogic.gdx.pay.ios.apple.PurchaseManageriOSApple$IosFetchProductsAndInstallDelegate.$cb$productsRequest$didReceiveResponse$(PurchaseManageriOSApple.java)
at org.robovm.apple.uikit.UIApplication.main(Native Method) at org.robovm.apple.uikit.UIApplication.main(UIApplication.java:428)
at com.squins.tkl.ios.common.IosLauncher$Companion.start(IosLauncher.kt:280) at com.squins.tkl.ios.es.IosEsLauncher$Companion.main(IosEsLauncher.kt:22)
at com.squins.tkl.ios.es.IosEsLauncher.main(IosEsLauncher.kt)
So synchronisation is not the issue. Add try-catch block around it then?
That will help for sure and I think it is an acceptable option here.
Made a change, let us know if it helps by closing this issue. :)
Took a while, new app with this gdx-pay just got accepted, now have to wait for 1-2 weeks to see the results
No longer appearing. Thanks for your efforts
Please ensure you have given all the following requested information in your report.
We see some crashes in Fabric related to gdx-pay. Not got any crashes myself.
Issue details, reproduction steps/code
gdx-pay version: 0.12.1
We see crashes in Fabric. Most iPhone X (78%), 99% of users has iOS 12.
Version of gdx-pay and/or relevant dependencies
0.12.1
Stacktrace
Please select the affected platforms and payment service implementation
We have set 'shouldProcessPromotionalStorePayment' to false. Kotlin implementation: