PayMaya / PayMaya-Android-SDK-v2

MIT License
12 stars 6 forks source link

IllegalArgumentException: Can only use lower 16 bits for requestCode #2

Closed jcchikikomori closed 4 years ago

jcchikikomori commented 4 years ago

I was transitioning using your SDK from Version 1 to Version 2, and I got this error. Maybe your requestCode was higher than the framework allowed or higher than 16 bits of integer value

Reference: https://stackoverflow.com/a/33332468/6413072

rjarce commented 4 years ago

Hi @jcchikikomori , can you share the full stack trace for this exception? Thanks

jcchikikomori commented 4 years ago

Hi @jcchikikomori , can you share the full stack trace for this exception? Thanks

Here's my stack trace.

Fatal Exception: java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode
       at androidx.fragment.app.FragmentActivity.checkForValidRequestCode(FragmentActivity.java:715)
       at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:660)
       at com.paymaya.sdk.android.checkout.internal.PayMayaCheckoutImpl.startCheckoutActivityForResult(PayMayaCheckoutImpl.kt:57)
       at ph.REDACTED.REDACTED.ui.checkout.CheckoutPresenter.executePaymaya(CheckoutPresenter.kt:300)
       at ph.REDACTED.REDACTED.ui.checkout.CheckoutPresenter.access$executePaymaya(CheckoutPresenter.kt:38)
       at ph.REDACTED.REDACTED.ui.checkout.CheckoutPresenter$cartCheckoutCashless$1.onNext(CheckoutPresenter.kt:374)**
       at ph.REDACTED.REDACTED.ui.checkout.CheckoutPresenter$cartCheckoutCashless$1.onNext(CheckoutPresenter.kt:359)
       at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:201)
       at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255)
       at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
       at android.os.Handler.handleCallback(Handler.java:873)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:198)
       at android.app.ActivityThread.main(ActivityThread.java:6732)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
rjarce commented 4 years ago

Thanks @jcchikikomori . Will drop some changes on the requestCode constants and a snapshot library sometime this week.

iandr01d commented 4 years ago

@rjarce I am also facing the same issue. Have you fixed this? https://stackoverflow.com/questions/25529865/java-lang-illegalargumentexception-can-only-use-lower-16-bits-for-requestcode