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] Crash on calling presentPaymentSheet #212

Closed
spencercarli opened this issue May 13, 2021 · 1 comment · Fixed by #224
Closed

[Android] Crash on calling presentPaymentSheet #212

spencercarli opened this issue May 13, 2021 · 1 comment · Fixed by #224
Labels
bug Something isn't working P0 Address these issues first

Comments

@spencercarli
Copy link

spencercarli commented May 13, 2021

Describe the bug
App crashes upon calling presentPaymentSheet on Android. Works fine on iOS and I'm seeing successful transactions.

To Reproduce

React Native Repo

Server Impementation (Glitch)

Steps to reproduce the behavior:

  1. Create new React Native project
  2. Install Stripe library following instructions.
  3. Run app and attempt to checkout

Expected behavior
App allows you to checkout using presentPaymentSheet.

Smartphone (please complete the following information):

  • Device: Pixel 3 Emulator
  • OS: Android
  • Version 9
  • React Native Stripe version: 0.1.0

Additional context
Logcat output

05-13 10:26:52.480  9339  9339 E AndroidRuntime: FATAL EXCEPTION: main
05-13 10:26:52.480  9339  9339 E AndroidRuntime: Process: com.stripedemo, PID: 9339
05-13 10:26:52.480  9339  9339 E AndroidRuntime: android.view.InflateException: Binary XML file line #106: Binary XML file line #106: Error inflating class com.stripe.android.paymentsheet.ui.BillingAddressView
05-13 10:26:52.480  9339  9339 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #106: Error inflating class com.stripe.android.paymentsheet.ui.BillingAddressView
05-13 10:26:52.480  9339  9339 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at java.lang.reflect.Constructor.newInstance0(Native Method)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createView(LayoutInflater.java:647)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at com.stripe.android.paymentsheet.BaseAddCardFragment.onCreateView(BaseAddCardFragment.kt:81)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:873)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:193)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6669)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #15: Binary XML file line #15: Error inflating class com.stripe.android.view.CountryTextInputLayout
05-13 10:26:52.480  9339  9339 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class com.stripe.android.view.CountryTextInputLayout
05-13 10:26:52.480  9339  9339 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at java.lang.reflect.Constructor.newInstance0(Native Method)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createView(LayoutInflater.java:647)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at com.stripe.android.databinding.StripeBillingAddressLayoutBinding.inflate(StripeBillingAddressLayoutBinding.java:111)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at com.stripe.android.paymentsheet.ui.BillingAddressView.<init>(BillingAddressView.kt:56)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at com.stripe.android.paymentsheet.ui.BillingAddressView.<init>(BillingAddressView.kt:30)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at com.stripe.android.paymentsheet.ui.BillingAddressView.<init>(Unknown Source:11)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at java.lang.reflect.Constructor.newInstance0(Native Method)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
05-13 10:26:52.480  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createView(LayoutInflater.java:647)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at com.stripe.android.paymentsheet.BaseAddCardFragment.onCreateView(BaseAddCardFragment.kt:81)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:873)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:193)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6669)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: Caused by: android.content.res.Resources$NotFoundException: Drawable com.stripedemo:color/stripe_paymentsheet_elements_background_states with resource ID #0x7f0500fa
05-13 10:26:52.486  9339  9339 E AndroidRuntime: Caused by: android.content.res.Resources$NotFoundException: File res/color/stripe_paymentsheet_elements_background_states.xml from drawable resource ID #0x7f0500fa
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:847)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:631)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.content.res.Resources.loadDrawable(Resources.java:897)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:955)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.content.res.TypedArray.getDrawable(TypedArray.java:930)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.View.<init>(View.java:5010)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.ViewGroup.<init>(ViewGroup.java:659)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.widget.LinearLayout.<init>(LinearLayout.java:244)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.widget.LinearLayout.<init>(LinearLayout.java:240)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:426)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at com.stripe.android.view.CountryTextInputLayout.<init>(CountryTextInputLayout.kt:38)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at com.stripe.android.view.CountryTextInputLayout.<init>(CountryTextInputLayout.kt:34)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at com.stripe.android.view.CountryTextInputLayout.<init>(Unknown Source:11)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at java.lang.reflect.Constructor.newInstance0(Native Method)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createView(LayoutInflater.java:647)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at com.stripe.android.databinding.StripeBillingAddressLayoutBinding.inflate(StripeBillingAddressLayoutBinding.java:111)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at com.stripe.android.paymentsheet.ui.BillingAddressView.<init>(BillingAddressView.kt:56)
05-13 10:26:52.486  9339  9339 E AndroidRuntime: 	at com.stripe.android.paymentsheet.ui.BillingAddressView.<init>(BillingAddressView.kt:30)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at com.stripe.android.paymentsheet.ui.BillingAddressView.<init>(Unknown Source:11)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at java.lang.reflect.Constructor.newInstance0(Native Method)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createView(LayoutInflater.java:647)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at com.stripe.android.paymentsheet.BaseAddCardFragment.onCreateView(BaseAddCardFragment.kt:81)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:873)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:193)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6669)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #2: <item> tag requires a 'drawable' attribute or child tag defining a drawable
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.graphics.drawable.StateListDrawable.inflateChildElements(StateListDrawable.java:190)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:122)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.graphics.drawable.DrawableInflater.inflateFromXmlForDensity(DrawableInflater.java:142)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.graphics.drawable.Drawable.createFromXmlInnerForDensity(Drawable.java:1332)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.graphics.drawable.Drawable.createFromXmlForDensity(Drawable.java:1291)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:833)
05-13 10:26:52.490  9339  9339 E AndroidRuntime: 	... 53 more
05-13 10:26:52.503  1974  4222 W ActivityManager:   Force finishing activity com.stripedemo/com.stripe.android.paymentsheet.PaymentSheetActivity
05-13 10:26:52.513  1974  4222 W ActivityManager:   Force finishing activity com.stripedemo/.MainActivity
@arekkubaczkowski
Copy link
Collaborator

thanks for flagging, we are working on it! for now you can try run app with higher version of android (10 or 11)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 Address these issues first
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants