Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Android : Instantly crashes when trying to use PaymentCardTextField #796

Closed
pnogier opened this issue Jun 28, 2021 · 4 comments
Closed

Android : Instantly crashes when trying to use PaymentCardTextField #796

pnogier opened this issue Jun 28, 2021 · 4 comments

Comments

@pnogier
Copy link

pnogier commented Jun 28, 2021

Before I have submitted the issue

[x] I have read an installation guide
[x] I know that for an iOS I need to install pods because I've read the installation guide
[x] I have read a linking guide and checked that everything is OK like in manual linking guide
[x] I know that before using tipsi-stripe I need to set options for my app as described in usage guide

The problem

Hi there, using PaymentCardTextField in Android throws me this error : java.lang.IllegalArgumentException: Unable to find JSIModule for class UIManager.
I'm really struggling with this issue and need to find a fix, does someone have an idea about how to fix it ? 🙏
Cheers

Environment

  • tipsi-stripe version: 9.1.1
  • Last tipsi-stripe version where the issue was not reproduced (if applicable):
  • iOS or Android: Android
  • OS version: Android 28
  • React-Native version: 0.64.1
  • (Android only) com.google.firebase:firebase-core version: 16.0.7
  • (Android only) com.google.android.gms:play-services-base version:

Links to logs and sources

Here is the full error stack

2021-06-28 15:19:20.899 7200-7200/com.getspacial.mobileapp E/InputEventReceiver: Exception dispatching input event.
2021-06-28 15:19:20.899 7200-7200/com.getspacial.mobileapp E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
2021-06-28 15:19:20.900 7200-7200/com.getspacial.mobileapp E/MessageQueue-JNI: java.lang.IllegalArgumentException: Unable to find JSIModule for class UIManager
        at com.facebook.react.bridge.JSIModuleRegistry.getModule(JSIModuleRegistry.java:24)
        at com.facebook.react.bridge.CatalystInstanceImpl.getJSIModule(CatalystInstanceImpl.java:564)
        at com.facebook.react.uimanager.UIManagerHelper.getUIManager(UIManagerHelper.java:90)
        at com.facebook.react.uimanager.UIManagerHelper.getUIManager(UIManagerHelper.java:46)
        at com.facebook.react.uimanager.UIManagerHelper.getUIManagerForReactTag(UIManagerHelper.java:40)
        at com.facebook.react.animated.NativeAnimatedNodesManager.handleEvent(NativeAnimatedNodesManager.java:505)
        at com.facebook.react.animated.NativeAnimatedNodesManager.onEventDispatch(NativeAnimatedNodesManager.java:483)
        at com.facebook.react.uimanager.events.EventDispatcherImpl.dispatchEvent(EventDispatcherImpl.java:116)
        at com.facebook.react.uimanager.JSTouchDispatcher.handleTouchEvent(JSTouchDispatcher.java:74)
        at com.facebook.react.ReactRootView.dispatchJSTouchEvent(ReactRootView.java:283)
        at com.facebook.react.ReactRootView.onInterceptTouchEvent(ReactRootView.java:201)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2573)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:440)
        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1830)
        at android.app.Activity.dispatchTouchEvent(Activity.java:3400)
        at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:398)
        at android.view.View.dispatchPointerEvent(View.java:12752)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5106)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4909)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4426)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4479)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4445)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4585)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4453)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4642)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4426)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4479)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4445)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4453)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4426)
        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7092)
        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7061)
        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7022)
        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7195)
        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:186)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:326)
        at android.os.Looper.loop(Looper.java:160)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
    	at java.lang.reflect.Method.invoke(Na
2021-06-28 15:19:20.900 7200-7200/com.getspacial.mobileapp D/AndroidRuntime: Shutting down VM
2021-06-28 15:19:20.902 7200-7200/com.getspacial.mobileapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.getspacial.mobileapp, PID: 7200
    java.lang.IllegalArgumentException: Unable to find JSIModule for class UIManager
        at com.facebook.react.bridge.JSIModuleRegistry.getModule(JSIModuleRegistry.java:24)
        at com.facebook.react.bridge.CatalystInstanceImpl.getJSIModule(CatalystInstanceImpl.java:564)
        at com.facebook.react.uimanager.UIManagerHelper.getUIManager(UIManagerHelper.java:90)
        at com.facebook.react.uimanager.UIManagerHelper.getUIManager(UIManagerHelper.java:46)
        at com.facebook.react.uimanager.UIManagerHelper.getUIManagerForReactTag(UIManagerHelper.java:40)
        at com.facebook.react.animated.NativeAnimatedNodesManager.handleEvent(NativeAnimatedNodesManager.java:505)
        at com.facebook.react.animated.NativeAnimatedNodesManager.onEventDispatch(NativeAnimatedNodesManager.java:483)
        at com.facebook.react.uimanager.events.EventDispatcherImpl.dispatchEvent(EventDispatcherImpl.java:116)
        at com.facebook.react.uimanager.JSTouchDispatcher.handleTouchEvent(JSTouchDispatcher.java:74)
        at com.facebook.react.ReactRootView.dispatchJSTouchEvent(ReactRootView.java:283)
        at com.facebook.react.ReactRootView.onInterceptTouchEvent(ReactRootView.java:201)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2573)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:440)
        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1830)
        at android.app.Activity.dispatchTouchEvent(Activity.java:3400)
        at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:398)
        at android.view.View.dispatchPointerEvent(View.java:12752)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5106)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4909)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4426)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4479)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4445)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4585)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4453)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4642)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4426)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4479)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4445)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4453)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4426)
        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7092)
        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7061)
        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7022)
        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7195)
        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:186)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:326)
        at android.os.Looper.loop(Looper.java:160)
2021-06-28 15:19:20.903 7200-7200/com.getspacial.mobileapp E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
2021-06-28 15:19:03.858 7200-7200/com.getspacial.mobileapp D/TextClassifierService: No configured system TextClassifierService

For Android, please provide the following sections from android/app/build.gradle:

  • android.compileSdkVersion : 29
  • android.buildToolsVersion : 29.0.3
  • android.defaultConfig.minSdkVersion : 21
  • android.defaultConfig.targetSdkVersion : 29
  • android.defaultConfig.multiDexEnabled (if exists) : true
@pnogier pnogier changed the title Android : Crash instantly when trying to use PaymentCardTextField Android : Instantly crashes when trying to use PaymentCardTextField Jun 28, 2021
@pnogier
Copy link
Author

pnogier commented Jun 28, 2021

Ok I ended up upgrading to RN 0.64.2, this issue was fixed in this version : facebook/react-native#31245 (comment)

Now I am getting this error and it crashes again...

2021-06-28 16:44:54.829 6611-6611/com.getspacial.mobileapp D/CustomCardInputReactManager: onTextChanged: cardNumber = 4
2021-06-28 16:44:54.834 6611-6611/com.getspacial.mobileapp D/AndroidRuntime: Shutting down VM
2021-06-28 16:44:54.843 6611-6611/com.getspacial.mobileapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.getspacial.mobileapp, PID: 6611
    java.lang.AssertionError: Dispatched event hasn't been initialized
        at com.facebook.infer.annotation.Assertions.assertCondition(Assertions.java:72)
        at com.facebook.react.uimanager.events.EventDispatcherImpl.dispatchEvent(EventDispatcherImpl.java:113)
        at com.gettipsi.stripe.CustomCardInputReactManager.postEvent(CustomCardInputReactManager.java:189)
        at com.gettipsi.stripe.CustomCardInputReactManager.access$200(CustomCardInputReactManager.java:25)
        at com.gettipsi.stripe.CustomCardInputReactManager$2.onTextChanged(CustomCardInputReactManager.java:129)
        at android.widget.TextView.sendOnTextChanged(TextView.java:9754)
        at android.widget.TextView.handleTextChanged(TextView.java:9851)
        at android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:12509)
        at android.text.SpannableStringBuilder.sendTextChanged(SpannableStringBuilder.java:1263)
        at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:575)
        at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:506)
        at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:36)
        at android.text.method.NumberKeyListener.onKeyDown(NumberKeyListener.java:131)
        at android.widget.TextView.doKeyDown(TextView.java:7665)
        at android.widget.TextView.onKeyDown(TextView.java:7442)
        at android.view.KeyEvent.dispatch(KeyEvent.java:2692)
        at android.view.View.dispatchKeyEvent(View.java:12450)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.widget.HorizontalScrollView.dispatchKeyEvent(HorizontalScrollView.java:362)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:389)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:389)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at com.facebook.react.ReactRootView.dispatchKeyEvent(ReactRootView.java:234)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
        at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:428)
        at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1820)
        at android.app.Activity.dispatchKeyEvent(Activity.java:3360)
        at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:122)
        at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84)
        at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140)
        at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:599)
2021-06-28 16:44:54.843 6611-6611/com.getspacial.mobileapp E/AndroidRuntime:     at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
        at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3068)
        at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:342)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5037)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4905)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4426)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4479)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4445)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4585)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4453)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4642)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4426)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4479)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4445)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4453)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4426)
        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7092)
        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7061)
        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7022)
        at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:4203)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
2021-06-28 16:44:55.110 6611-6611/com.getspacial.mobileapp I/Process: Sending signal. PID: 6611 SIG: 9

@sccainsa
Copy link

sccainsa commented Jun 29, 2021

I ran into the same issue.

I believe this was caused by a change made for #790

I believe it is because the constructor for
node_modules\tipsi-stripe\android\src\main\java\com\gettipsi\stripe\CreditCardFormOnChangeEvent, doesn't pass the viewId along to the base constructor, causing the even to not be initialized.

    public CreditCardFormOnChangeEvent(int id, WritableMap params, boolean isValid) {
        super();
        this.params = params;
        this.isValid = isValid;
    }

I believe that can be changed to the following:

    public CreditCardFormOnChangeEvent(int id, WritableMap params, boolean isValid) {
        super(id);
        this.params = params;
        this.isValid = isValid;
    }

@pnogier
Copy link
Author

pnogier commented Jun 29, 2021

@sccainsa Hi, thank you for your answer, I ended up migrating to the official stripe SDK.
But, there I still faced the first issue, which was once again solved by upgrading RN from 0.64.1 to 0.64.2.
Keeping the issue open for now as you mentioned it in a PR

@cybergrind
Copy link
Member

you can get it with npm install tipsi-stripe@9.1.3

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

No branches or pull requests

3 participants