'platform exception in stripe_flutter

Describe the bug im facing the issue after the server to getting the clientsecret successfully after that i'm setup the stripe code then i click to hit the request of stripe payment getting I'm showing the platform exception i'm already update mainactivity.kt file fluttteractvity to fragment below im paste the my issue which one showing into log please check and help me how to fix

PlatformException(flutter_stripe initialization failed, The plugin failed to initialize: Your theme isn't set to use Theme.AppCompat or Theme.MaterialComponents. Please check the README: https://github.com/flutter-stripe/flutter_stripe#android, null, null)



Solution 1:[1]

I think You are using

<style name="LaunchTheme" parent="@android:style/Theme.AppCompat.Light.NoTitleBar">

And it should be:

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

or just, copy and paste all the file in style.xml

https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/app/src/main/res/values/styles.xml

Solution 2:[2]

Please add this to your both style file.

  1. /android/app/src/main/res/values/styles.xml 2./android/app/src/main/res/values-night/styles.xml

@drawable/launch_background true ?android:colorBackground

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Shailandra Rajput
Solution 2 Asif Taj