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

CardInputWidget crash when shouldRequirePostalCode="true" on imeAction next #2213

Closed
marcin-oziemski opened this issue Feb 24, 2020 · 5 comments

Comments

@marcin-oziemski
Copy link

marcin-oziemski commented Feb 24, 2020

Summary

CardInputWidget crash when shouldRequirePostalCode="true" and click imeAction next on postalCode EditText.

Code to reproduce

Just use normal
<com.stripe.android.view.CardInputWidget
and add
app:shouldRequirePostalCode="true"
in xml layout.

Android version

9 (Samsung S10)

Impacted devices

Probably more than just that one.

Installation method

gradle:
implementation "com.stripe:stripe-android:14.0.0"

SDK version

14.0.0 (also saw on 13.2.0)

Other information

logs:
2020-02-24 15:44:42.439 2983-2983/com.dev E/AndroidRuntime: FATAL EXCEPTION: main Process: com.dev, PID: 2983 java.lang.IllegalStateException: focus search returned a view that wasn't able to take focus! at android.widget.TextView.onKeyUp(TextView.java:8847) at android.view.KeyEvent.dispatch(KeyEvent.java:3383) at android.view.View.dispatchKeyEvent(View.java:13325) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912) at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:685) at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1869) at android.app.Activity.dispatchKeyEvent(Activity.java:3447) at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:115) at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84) at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:133) at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:558) at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59) at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:2814) at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:563) at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6038) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5893) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5346) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5399) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5365) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5524) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5373) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5581) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5346) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5399) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5365) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5373) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5346) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8408) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8341) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8294) at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:4983) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7037) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

@mshafrir-stripe
Copy link
Collaborator

@marcin-oziemski thanks for filing. Can you test on an Android Emulator to confirm if this crash is device specific? I wasn't able to reproduce based on the description you gave.

@mshafrir-stripe
Copy link
Collaborator

@marcin-oziemski I did notice that the imeOptions value wasn't set on the postal code field. #2215 fixes this, which may be related to the crash.

@marcin-oziemski
Copy link
Author

Hey @msaffitz-stripe i done it on emulator with the same behavior.
image

@mshafrir-stripe
Copy link
Collaborator

@marcin-oziemski can you do a video capture so I can try to reproduce?

@marcin-oziemski
Copy link
Author

marcin-oziemski commented Feb 25, 2020

Strange but in isolation it actually works, so this is probably some other issue as still the selection is visible on postal code but it the maybe catch some other focus and thats could be the cause, sorry for problem.

@edit: when removing postal code and CVC is the last item with ime action DONE it works perfectly so changing ime action on postal code to DONE will also be a solution for that problem.
With CardMultilineWidget it works perfectly.

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

2 participants