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

Android application crashes after successful callback from requestPurchase #512

Closed
kabucey opened this issue Jun 9, 2019 · 1 comment
Closed
Labels
🤖 android Related to android 🐛 bug Something isn't working

Comments

@kabucey
Copy link

kabucey commented Jun 9, 2019

Version of react-native-iap

3.0.0-rc.0

Version of react-native

0.59.8

Platforms you faced the error (IOS or Android or both?)

Android

Expected behavior

No crashes.

Actual behavior

After the purchase listener is successfully called, the application crashes with the following error:

    com.facebook.react.bridge.ObjectAlreadyConsumedException: Map already consumed
    at com.facebook.react.bridge.WritableNativeArray.pushNativeMap(Native Method)
    at com.facebook.react.bridge.WritableNativeArray.pushMap(WritableNativeArray.java:56)
    at com.facebook.react.bridge.Arguments.fromJavaArgs(Arguments.java:187)
    at com.facebook.react.bridge.CallbackImpl.invoke(CallbackImpl.java:32)
    at com.facebook.react.bridge.PromiseImpl.resolve(PromiseImpl.java:57)
    at com.dooboolab.RNIap.DoobooUtils.resolvePromisesForKey(DoobooUtils.java:121)
    at com.dooboolab.RNIap.RNIapModule.onPurchasesUpdated(RNIapModule.java:489)
    at com.android.billingclient.api.BillingClientImpl$1.onReceiveResult(BillingClientImpl.java:182)
    at android.os.ResultReceiver$MyRunnable.run(ResultReceiver.java:50)
    at android.os.Handler.handleCallback(Handler.java:790)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6494)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Tested environment (Emulator? Real Device?)

Emulator

Steps to reproduce the behavior

Implement v3 of the purchase callback and call requestPurchase with a valid product id. Purchase the item with the test card that always returns a success. The callback will be called successfully, however the app crashes afterwards.

@hyochan hyochan added 🤖 android Related to android 🐛 bug Something isn't working labels Jun 10, 2019
@hyochan
Copy link
Owner

hyochan commented Jun 10, 2019

Released 3.0.0-rc.1. Sorry for this. I've not updated some codes in our module that was used in testing (this has bad testing env).

@hyochan hyochan mentioned this issue Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 android Related to android 🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants