Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The SDK crashes during initialization when using with Amazon IAP AppStore SDK 3.0.2 #1595

Closed
Avivma opened this issue May 26, 2022 · 9 comments

Comments

@Avivma
Copy link

Avivma commented May 26, 2022

Description:
App crashes after a call to OneSignal.initWithContext(context). See stacktrace below.

The reason is because TrackAmazonPurchase class calls for: PurchasingService.registerListener(this.context, this.osPurchasingListener); not on the main thread.
This method PurchasingService.registerListener, should only be called on the main thread.
According to Amazon IAP doc: https://developer.amazon.com/docs/in-app-purchasing/iap-implement-iap.html#purchasingservice

Environment
OneSignal 4.7.3
amazon-appstore-sdk 3.0.2

Steps to Reproduce Issue:

  1. Add the OneSignal SDK to your project
  2. Add Android IAP sdk to your project
  3. Call for OneSignal.initWithContext(context)
  4. Run the app

Anything else:
Stacktrace:
2022-05-26 18:06:05.317 E/AndroidRuntime: FATAL EXCEPTION: OS_REST_SUCCESS_CALLBACK
Process: com.checkpoint.zonealarm.mobilesecurity, PID: 5934
com.amazon.a.a.o.a.b: Executing thread must be thread: 2, was: 81373
at com.amazon.a.a.o.a.a.a(Assert.java:59)
at com.amazon.a.a.o.a.a.a(Assert.java:48)
at com.amazon.a.a.o.a.a.a(Assert.java:31)
at com.amazon.a.a.k.c.a(ResourceManagerImpl.java:50)
at com.amazon.a.a.k.c.(ResourceManagerImpl.java:34)
at com.amazon.a.a.b(AppstoreSDK.java:169)
at com.amazon.a.a.(AppstoreSDK.java:153)
at com.amazon.a.a.a(AppstoreSDK.java:232)
at com.amazon.device.iap.PurchasingService.registerListener(PurchasingService.java:89)
at com.onesignal.TrackAmazonPurchase.setListener(TrackAmazonPurchase.java:107)
at com.onesignal.TrackAmazonPurchase.(TrackAmazonPurchase.java:84)
at com.onesignal.OneSignal.handleAmazonPurchase(OneSignal.java:978)
at com.onesignal.OneSignal.init(OneSignal.java:855)
at com.onesignal.OneSignal.setAppId(OneSignal.java:730)
at com.onesignal.OneSignal.reassignDelayedInitParams(OneSignal.java:1174)
at com.onesignal.OneSignal.onRemoteParamSet(OneSignal.java:882)
at com.onesignal.OneSignal$7.complete(OneSignal.java:1115)
at com.onesignal.OneSignalRemoteParams.processJson(OneSignalRemoteParams.java:211)
at com.onesignal.OneSignalRemoteParams.access$100(OneSignalRemoteParams.java:12)
at com.onesignal.OneSignalRemoteParams$1.onSuccess(OneSignalRemoteParams.java:156)
at com.onesignal.OneSignalRestClient$5.run(OneSignalRestClient.java:279)
at java.lang.Thread.run(Thread.java:923)

@jkasten2
Copy link
Member

@Avivma Thanks for reporting, your recommendation of calling on the main thread looks correct based on the error you are seeing. We address this and update this thread once a fix is released.

@jkasten2 jkasten2 changed the title The SDK crashes during initialization when using with AppStore SDK in version 3.0.2 The SDK crashes during initialization when using with Amazon IAP AppStore SDK in version 3.0.2 May 26, 2022
@jkasten2 jkasten2 changed the title The SDK crashes during initialization when using with Amazon IAP AppStore SDK in version 3.0.2 The SDK crashes during initialization when using with Amazon IAP AppStore SDK 3.0.2 May 26, 2022
@Avivma
Copy link
Author

Avivma commented Jun 1, 2022

Hi jkasten2, do know when this fix will be ready?
I currently, can't use your services in my app :(

@Avivma
Copy link
Author

Avivma commented Jun 14, 2022

Hi jkasten2, just a kindly reminder. I still can't use your services in my app.
Please let me if there is an update on this issue.

@jkasten2
Copy link
Member

We don't have an update at this time, we will still address this issue. PRs are welcome if you are able to find a fix for the issue.

@giovanni256
Copy link

giovanni256 commented Aug 6, 2022

Following, same issue here using RevenueCat 4.0.0 on Flutter.

@jkasten2

@vegaro
Copy link

vegaro commented Aug 9, 2022

I work for RevenueCat and I just wanted to follow up here for visibility. We currently depend on the Amazon Appstore SDK 3.0.3 and we include it in our plugin. We don't use the jar anymore since v3 is finally being distributed on Maven Central. It looks like your SDK is not including the jar in runtime and it's only compiling against it, so when it runs alongside our plugin, it will crash due to the runtime version being different from what your code expects.

@jmadler
Copy link
Contributor

jmadler commented Aug 9, 2022

Thanks folks. Interoperability with RevenueCat is of critical importance to us. We'll dig in deeper ASAP.

@emawby
Copy link
Contributor

emawby commented Aug 10, 2022

Fixed by version 4.8.2 #1622

@emawby emawby closed this as completed Aug 10, 2022
@jetie000
Copy link

Have similar issue with Ionic + Capacitor + Vue

newest versions of libs
@revenuecat/purchases-capacitor: 9.2.1
onesignal-cordova-plugin: 5.2.9

revenuecat was already integrated and worked fine, faced that issue on android 15 device when added OneSignal.initialize() method with OneSignal app id to App.vue

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants