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

No implementation found for method requestFocus on channel flutter.stripe/card_field/0 #69

Closed
ZaifSenpai opened this issue May 25, 2021 · 4 comments

Comments

@ZaifSenpai
Copy link

okay first thing: Please mention that we have to upgrade kotlin version of our project to 1.5.0. I spent too much time on this because I was getting errors and the reason was that my kotlin version was 1.3.50

After upgrading it I am trying to use this library but I get following error when I try to use CardField:

E/flutter ( 9127): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method requestFocus on channel flutter.stripe/card_field/0)
E/flutter ( 9127): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
E/flutter ( 9127): <asynchronous suspension>
E/flutter ( 9127): 
E/flutter ( 9127): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method onPlaceholderChanged on channel flutter.stripe/card_field/0)
E/flutter ( 9127): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
E/flutter ( 9127): <asynchronous suspension>
E/flutter ( 9127): 
[GETX] CLOSE BOTTOMSHEET: 326924694
E/flutter ( 9127): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method clearFocus on channel flutter.stripe/card_field/0)
E/flutter ( 9127): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
E/flutter ( 9127): <asynchronous suspension>

Full details from Logcat:

2021-05-25 13:46:24.237 9127-9127/com.takeaway.machers.machers_takeaway E/MethodChannel#flutter/platform_views: Failed to handle method call
    android.view.InflateException: Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Error inflating class <unknown>
    Caused by: android.view.InflateException: Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Error inflating class <unknown>
    Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
        at android.view.LayoutInflater.createView(LayoutInflater.java:854)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:656)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
        at com.stripe.android.databinding.CardInputWidgetBinding.inflate(CardInputWidgetBinding.java:88)
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:63)
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:57)
        at com.reactnativestripesdk.StripeSdkCardView.<init>(StripeSdkCardView.kt:27)
        at com.reactnativestripesdk.StripeSdkCardViewManager.createViewInstance(StripeSdkCardViewManager.kt:47)
        at com.flutter.stripe.StripeSdkCardPlatformView.<init>(StripeSdkCardPlatformView.kt:30)
        at com.flutter.stripe.StripeSdkCardPlatformViewFactory.create(StripeSdkCardPlatformViewFactory.kt:19)
        at io.flutter.plugin.platform.PlatformViewsController$1.createAndroidViewForPlatformView(PlatformViewsController.java:146)
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:101)
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:336)
        at android.os.Looper.loop(Looper.java:174)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.AppCompat (or a descendant).
        at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:243)
        at com.google.android.material.internal.ThemeEnforcement.checkAppCompatTheme(ThemeEnforcement.java:213)
        at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:148)
        at com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(ThemeEnforcement.java:115)
        at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:463)
        at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:422)
        at java.lang.reflect.Constructor.newInstance0(Native Method) 
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 
        at android.view.LayoutInflater.createView(LayoutInflater.java:854) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:656) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:534) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:481) 
        at com.stripe.android.databinding.CardInputWidgetBinding.inflate(CardInputWidgetBinding.java:88) 
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:63) 
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:57) 
        at com.reactnativestripesdk.StripeSdkCardView.<init>(StripeSdkCardView.kt:27) 
        at com.reactnativestripesdk.StripeSdkCardViewManager.createViewInstance(StripeSdkCardViewManager.kt:47) 
        at com.flutter.stripe.StripeSdkCardPlatformView.<init>(StripeSdkCardPlatformView.kt:30) 
        at com.flutter.stripe.StripeSdkCardPlatformViewFactory.create(StripeSdkCardPlatformViewFactory.kt:19) 
        at io.flutter.plugin.platform.PlatformViewsController$1.createAndroidViewForPlatformView(PlatformViewsController.java:146) 
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:101) 
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59) 
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233) 
        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) 
        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818) 
        at android.os.MessageQueue.nativePollOnce(Native Method) 
        at android.os.MessageQueue.next(MessageQueue.java:336) 
        at android.os.Looper.loop(Looper.java:174) 
        at android.app.ActivityThread.main(ActivityThread.java:7356) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 
2021-05-25 13:46:24.254 9127-9169/com.takeaway.machers.machers_takeaway E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: PlatformException(error, Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Error inflating class <unknown>, null, android.view.InflateException: Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Error inflating class <unknown>
    Caused by: android.view.InflateException: Binary XML file line #22 in com.takeaway.machers.machers_takeaway:layout/card_input_widget: Error inflating class <unknown>
    Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
        at android.view.LayoutInflater.createView(LayoutInflater.java:854)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:656)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
        at com.stripe.android.databinding.CardInputWidgetBinding.inflate(CardInputWidgetBinding.java:88)
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:63)
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:57)
        at com.reactnativestripesdk.StripeSdkCardView.<init>(StripeSdkCardView.kt:27)
        at com.reactnativestripesdk.StripeSdkCardViewManager.createViewInstance(StripeSdkCardViewManager.kt:47)
        at com.flutter.stripe.StripeSdkCardPlatformView.<init>(StripeSdkCardPlatformView.kt:30)
        at com.flutter.stripe.StripeSdkCardPlatformViewFactory.create(StripeSdkCardPlatformViewFactory.kt:19)
        at io.flutter.plugin.platform.PlatformViewsController$1.createAndroidViewForPlatformView(PlatformViewsController.java:146)
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:101)
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:336)
        at android.os.Looper.loop(Looper.java:174)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.AppCompat (or a descendant).
        at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:243)
        at com.google.android.material.internal.ThemeEnforcement.checkAppCompatTheme(ThemeEnforcement.java:213)
        at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:148)
        at com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(ThemeEnforcement.java:115)
        at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:463)
        at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:422)
        at java.lang.reflect.Constructor.newInstance0(Native Method) 
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 
        at android.view.LayoutInflater.createView(LayoutInflater.java:854) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:656) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:534) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:481) 
        at com.stripe.android.databinding.CardInputWidgetBinding.inflate(CardInputWidgetBinding.java:88) 
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:63) 
        at com.stripe.android.view.CardInputWidget.<init>(CardInputWidget.kt:57) 
        at com.reactnativestripesdk.StripeSdkCardView.<init>(StripeSdkCardView.kt:27) 
        at com.reactnativestripesdk.StripeSdkCardViewManager.createViewInstance(StripeSdkCardViewManager.kt:47) 
        at com.flutter.stripe.StripeSdkCardPlatformView.<init>(StripeSdkCardPlatformView.kt:30) 
        at com.flutter.stripe.StripeSdkCardPlatformViewFactory.create(StripeSdkCardPlatformViewFactory.kt:19) 
        at io.flutter.plugin.platform.PlatformViewsController$1.createAndroidViewForPlatformView(PlatformViewsController.java:146) 
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:101) 
        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59) 
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233) 
        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) 
        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818) 
        at android.os.MessageQueue.nativePollOnce(Native Method) 
        at android.os.MessageQueue.next(MessageQueue.java:336) 
        at android.os.Looper.loop(Looper.java:174) 
        at android.app.ActivityThread.main(ActivityThread.java:7356) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 
    )
    #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dar
2021-05-25 13:46:24.254 9127-9169/com.takeaway.machers.machers_takeaway E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method requestFocus on channel flutter.stripe/card_field/3)
    #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
    <asynchronous suspension>
2021-05-25 13:46:24.275 9127-9169/com.takeaway.machers.machers_takeaway E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method onPlaceholderChanged on channel flutter.stripe/card_field/3)
    #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
    <asynchronous suspension>
@jamesblasco
Copy link
Member

Hello @ZaifSenpai, could you check if the theme inside your android app is a Theme.AppCompact descendant like the example one?

<style name="NormalTheme" parent="Theme.AppCompat.Light.NoActionBar">

The native stripe library makes use of AppCompact components and therefore it is required to use it.

Let us know if that solves your problem.

I will add it to the readme.

Thank you for taking care of creating this issue

@ZaifSenpai
Copy link
Author

Thank you. That worked.

@kekko7072
Copy link

I had the same problem and fixed using it, should be added to info package.

@mike392
Copy link

mike392 commented May 31, 2021

Hello @ZaifSenpai, could you check if the theme inside your android app is a Theme.AppCompact descendant like the example one?

<style name="NormalTheme" parent="Theme.AppCompat.Light.NoActionBar">

The native stripe library makes use of AppCompact components and therefore it is required to use it.

Let us know if that solves your problem.

I will add it to the readme.

Thank you for taking care of creating this issue

This actually helped! Thank you so much!

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

4 participants