-
-
Notifications
You must be signed in to change notification settings - Fork 539
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
Error when using the Card Field Widget #142
Comments
Please, make sure to follow all the requirements needed for Android Probably your Android Theme is not of type Theme.AppCompact. |
Yeah, I followed all the steps in the link and I still have that error. So I am stuck. Cant use the card field and cant use the payment sheet also. |
Please, for the CardField check again your android Theme. The error you shared is explicitly saying:
Notice making changes on Native android does not work with hot reload/hot restart. So you have to rebuild the app For the Payment Sheet, we are working on improving the error messages. But it probably is that the paymentIntentClientSecret you are creating for the server is not valid. If you could share the code from your server I would be happy to help. |
My styles.xml file. For the payment sheet: Flutter side: |
Thanks for sharing all the code. Very helpful. It all looks good. Could you check this? flutter_stripe/example/android/app/src/main/AndroidManifest.xml Lines 17 to 19 in cf38b15
And just to make sure, you have added the Stripe.publishableKey no? I don't see anything wrong with the PaymentSheet. I am going to try to dig a bit more into the problem. Thank you |
Yeah. I just checked the manifest file. And it has that block of code in exactly that format. And yeah, I added the publishableKey too. |
In my case, after changing app theme to
|
@jamesblasco The payment sheet still doesn't work for me tho. |
Documentation was added |
* sync android code * implement new parsing cardfield and paymentintent * comply to new result propagation for setupintent * sync ios * Update dart layer * Throw errors for easy debug + cancel login when error * workaround for stripe/stripe-react-native#368, also adjusted canceledAt * migrate to flutter_lints because pedantic is deprecated * implement create token method (#165) * implement create token method * add create token to example app * Add createToken for iOS * Make example tiles scrollable Co-authored-by: Jaime Blasco <[email protected]> * improve documentation for Android and issues #155 #142 * fix merge issue * add urlscheme to initialise method * BREAKING: rename threedsecure button config and add config theme for other buttons * BREAKING make paymentIntentClientSecret nullable and add setupIntentClientSecret for paymentsheet * add fontfamily and dangerouslyGetFullCardDetails to cardfield Co-authored-by: Remon <[email protected]> Co-authored-by: Remon Helmond <[email protected]> Co-authored-by: Jaime Blasco <[email protected]>
I added this but now I started getting this error: I have clean and build the app but still not able to get it working.
|
I just noticed It is not Theme.AppCompat.Black.NoTitleBar or Theme.AppCompat.Light.NoTitleBar It should be this:
|
In my case, neither
However, it started to compile, when I replaced |
I've tried all the "fixes" but I still get this error on the latest version which is 9.3.0. It works fine on iOS though! |
Any solutions? |
Error Encountered:
E/MethodChannel#flutter/platform_views(19580): Failed to handle method call
E/MethodChannel#flutter/platform_views(19580): android.view.InflateException: Binary XML file line #22 in com.crooz.ezze:layout/card_input_widget: Binary XML file line #22 in com.crooz.ezze:layout/card_input_widget: Error inflating class
E/MethodChannel#flutter/platform_views(19580): Caused by: android.view.InflateException: Binary XML file line #22 in com.crooz.ezze:layout/card_input_widget: Error inflating class
E/MethodChannel#flutter/platform_views(19580): Caused by: java.lang.reflect.InvocationTargetException
E/MethodChannel#flutter/platform_views(19580): at java.lang.reflect.Constructor.newInstance0(Native Method)
E/MethodChannel#flutter/platform_views(19580): at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
E/MethodChannel#flutter/platform_views(19580): at android.view.LayoutInflater.createView(LayoutInflater.java:854)
E/MethodChannel#flutter/platform_views(19580): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1010)
E/MethodChannel#flutter/platform_views(19580): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
E/MethodChannel#flutter/platform_views(19580): at android.view.LayoutInflater.rInflate(LayoutInflater.java:1140)
E/MethodChannel#flutter/platform_views(19580): at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1101)
E/MethodChannel#flutter/platform_views(19580): at android.view.LayoutInflater.rInflate(LayoutInflater.java:1143)
E/MethodChannel#flutter/platform_views(19580): at android.view.LayoutInflater.inflate(LayoutInflater.java:656)
E/MethodChannel#flutter/platform_views(19580): at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
E/MethodChannel#flutter/platform_views(19580): at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
E/MethodChannel#flutter/platform_views(19580): at com.stripe.android.databinding.CardInputWidgetBinding.inflate(CardInputWidgetBinding.java:88)
E/MethodChannel#flutter/platform_views(19580): at com.stripe.android.view.CardInputWidget.(CardInputWidget.kt:63)
E/MethodChannel#flutter/platform_views(19580): at com.stripe.android.view.CardInputWidget.(CardInputWidget.kt:57)
E/MethodChannel#flutter/platform_views(19580): at com.reactnativestripesdk.StripeSdkCardView.(StripeSdkCardView.kt:27)
E/MethodChannel#flutter/platform_views(19580): at com.reactnativestripesdk.StripeSdkCardViewManager.createViewInstance(StripeSdkCardViewManager.kt:47)
E/MethodChannel#flutter/platform_views(19580): at com.flutter.stripe.StripeSdkCardPlatformView.(StripeSdkCardPlatformView.kt:30)
E/MethodChannel#flutter/platform_views(19580): at com.flutter.stripe.StripeSdkCardPlatformViewFactory.create(StripeSdkCardPlatformViewFactory.kt:19)
E/MethodChannel#flutter/platform_views(19580): at io.flutter.plugin.platform.PlatformViewsController$1.createAndroidViewForPlatformView(PlatformViewsController.java:146)
E/MethodChannel#flutter/platform_views(19580): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:101)
E/MethodChannel#flutter/platform_views(19580): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/MethodChannel#flutter/platform_views(19580): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#flutter/platform_views(19580): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#flutter/platform_views(19580): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/MethodChannel#flutter/platform_views(19580): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#flutter/platform_views(19580): at android.os.MessageQueue.next(MessageQueue.java:336)
E/MethodChannel#flutter/platform_views(19580): at android.os.Looper.loop(Looper.java:174)
E/MethodChannel#flutter/platform_views(19580): at android.app.ActivityThread.main(ActivityThread.java:7386)
E/MethodChannel#flutter/platform_views(19580): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter/platform_views(19580): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/MethodChannel#flutter/platform_views(19580): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
E/MethodChannel#flutter/platform_views(19580): Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.AppCompat (or a descendant).
E/MethodChannel#flutter/platform_views(19580): at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:243)
E/MethodChannel#flutter/platform_views(19580): at com.google.android.material.internal.ThemeEnforcement.checkAppCompatTheme(ThemeEnforcement.java:213)
E/MethodChannel#flutter/platform_views(19580): at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:148)
E/MethodChannel#flutter/platform_views(19580): at com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(ThemeEnforcement.java:115)
E/MethodChannel#flutter/platform_views(19580): at com.google.android.material.textfield.TextInputLayout.(TextInputLayout.java:463)
E/MethodChannel#flutter/platform_views(19580): at com.google.android.material.textfield.TextInputLayout.(TextInputLayout.java:422)
E/MethodChannel#flutter/platform_views(19580): ... 31 more
I/System.out(19580): [socket]:check permission begin!
I/System.out(19580): [socket]:check permission begin!
E/flutter (19580): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(error, Binary XML file line #22 in com.crooz.ezze:layout/card_input_widget: Binary XML file line #22 in com.crooz.ezze:layout/card_input_widget: Error inflating class , null, android.view.InflateException: Binary XML file line #22 in com.crooz.ezze:layout/card_input_widget: Binary XML file line #22 in com.crooz.ezze:layout/card_input_widget: Error inflating class
E/flutter (19580): Caused by: android.view.InflateException: Binary XML file line #22 in com.crooz.ezze:layout/card_input_widget: Error inflating class
E/flutter (19580): Caused by: java.lang.reflect.InvocationTargetException
E/flutter (19580): at java.lang.reflect.Constructor.newInstance0(Native Method)
E/flutter (19580): at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
E/flutter (19580): at android.view.LayoutInflater.createView(LayoutInflater.java:854)
E/flutter (19580): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1010)
E/flutter (19580): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
E/flutter (19580): at android.view.LayoutInflater.rInflate(LayoutInflater.java:1140)
E/flutter (19580): at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1101)
E/flutter (19580): at android.view.LayoutInflater.rInflate(LayoutInflater.java:1143)
E/flutter (19580): at android.view.LayoutInflater.inflate(LayoutInflater.java:656)
E/flutter (19580): at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
E/flutter (19580): at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
E/flutter (19580): at com.stripe.android.databinding.CardInputWidgetBinding.inflate(CardInputWidgetBinding.java:88)
E/flutter (19580): at com.stripe.android.view.CardInputWidget.(CardInputWidget.kt:63)
E/flutter (19580): at com.stripe.android.view.CardInputWidget.(CardInputWidget.kt:57)
E/flutter (19580): at com.reactnativestripesdk.StripeSdkCardView.(StripeSdkCardView.kt:27)
E/flutter (19580): at com.reactnativestripesdk.StripeSdkCardViewManager.createViewInstance(StripeSdkCardViewManager.kt:47)
E/flutter (19580): at com.flutter.stripe.StripeSdkCardPlatformView.(StripeSdkCardPlatformView.kt:30)
E/flutter (19580): at com.flutter.stripe.StripeSdkCardPlatformViewFactory.create(StripeSdkCardPlatformViewFactory.kt:19)
E/flutter (19580): at io.flutter.plugin.platform.PlatformViewsController$1.createAndroidViewForPlatformView(PlatformViewsController.java:146)
E/flutter (19580): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:101)
E/flutter (19580): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/flutter (19580): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/flutter (19580): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/flutter (19580): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/flutter (19580): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (19580): at android.os.MessageQueue.next(MessageQueue.java:336)
E/flutter (19580): at android.os.Looper.loop(Looper.java:174)
E/flutter (19580): at android.app.ActivityThread.main(ActivityThread.java:7386)
E/flutter (19580): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (19580): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/flutter (19580): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
E/flutter (19580): Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.AppCompat (or a descendant).
E/flutter (19580): at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:243)
E/flutter (19580): at com.google.android.material.internal.ThemeEnforcement.checkAppCompatTheme(ThemeEnforcement.java:213)
E/flutter (19580): at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:148)
E/flutter (19580): at com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(ThemeEnforcement.java:115)
E/flutter (19580): at com.google.android.material.textfield.TextInputLayout.(TextInputLayout.java:463)
E/flutter (19580): at com.google.android.material.textfield.TextInputLayout.(TextInputLayout.java:422)
E/flutter (19580): ... 31 more
E/flutter (19580): )
E/flutter (19580): #0 StandardMethodCodec.decodeEnvelope
E/flutter (19580): #1 MethodChannel._invokeMethod
E/flutter (19580): <asynchron
E/flutter (19580): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: MissingPluginException(No implementation found for method requestFocus on channel flutter.stripe/card_field/1)
E/flutter (19580): #0 MethodChannel._invokeMethod
E/flutter (19580):
E/flutter (19580):
E/flutter (19580): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: MissingPluginException(No implementation found for method onPlaceholderChanged on channel flutter.stripe/card_field/1)
E/flutter (19580): #0 MethodChannel._invokeMethod
To Reproduce
Steps to reproduce the behavior:
Create a page with the CardField as a widget. Then navigate to that page
Expected behavior
Expected to see a Card form
Smartphone / tablet
The text was updated successfully, but these errors were encountered: